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

Check if symbolic link is relative to location path #942

Merged
merged 3 commits into from
Jun 2, 2020

Conversation

abraunegg
Copy link
Owner

  • If a symbolic link is 'relative', it is relative to the path where the symbolic link exists, not the current working directory. Test if the failed symbolic link read is due to the link being relative, and advise accordingly.

* If a symbolic link is 'relative', it is relative to the path where the symbolic link exists, not the current working directory. Test if the failed symbolic link read is due to the link being relative, and advise accordingly.
@abraunegg abraunegg added this to the v2.4.3 milestone May 30, 2020
@abraunegg
Copy link
Owner Author

abraunegg commented May 30, 2020

file setup:

total 0
drwxrwxr-x. 2 alex alex 46 May 30 09:16 .
drwxrwxr-x. 3 alex alex 35 May 30 09:14 ..
lrwxrwxrwx. 1 alex alex 61 May 30 09:16 absolute.txt -> /home/alex/OneDrivePersonal/link_tests/intercambio/prueba.txt
lrwxrwxrwx. 1 alex alex 13 May 30 09:16 relative.txt -> ../prueba.txt

Without PR:

./onedrive --confdir '~/.config/onedrive-personal/' --synchronize 
Configuration file successfully loaded
Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...
Skipping item - invalid symbolic link: ./link_tests/intercambio/inv/relative.txt

With PR:

./onedrive --confdir '~/.config/onedrive-personal/' --synchronize 
Configuration file successfully loaded
Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...
Uploading new file ./link_tests/intercambio/inv/relative.txt ... done.

@abraunegg abraunegg requested a review from norbusan May 30, 2020 00:25
* Relative links 'can' be uploaded .. thus, can be supported
@abraunegg
Copy link
Owner Author

@norbusan
This PR is now good for review & merge

src/sync.d Show resolved Hide resolved
src/sync.d Outdated Show resolved Hide resolved
* rely on 'relativeLink = readLink(fileName)' to test relative link state
@abraunegg
Copy link
Owner Author

@norbusan
Updated code handles the following symbolic links:

total 0
drwxrwxr-x. 2 alex alex 79 Jun  1 12:22 .
drwxrwxr-x. 3 alex alex 35 May 30 09:14 ..
lrwxrwxrwx. 1 alex alex 61 May 30 09:16 absolute.txt -> /home/alex/OneDrivePersonal/link_tests/intercambio/prueba.txt
lrwxrwxrwx. 1 alex alex 26 Jun  1 12:21 asdf.txt -> ../../../zzzz/asdfasdf.txt
lrwxrwxrwx. 1 alex alex 15 Jun  1 12:22 fubar.txt -> ./../prueba.txt
lrwxrwxrwx. 1 alex alex 13 May 30 09:16 relative.txt -> ../prueba.txt

@abraunegg abraunegg merged commit 8376a36 into master Jun 2, 2020
@abraunegg abraunegg deleted the fix-relative-symbolic-links branch June 2, 2020 03:47
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants