Skip to content

fix bug with absolute database path on windows#276

Closed
xeash wants to merge 3 commits intogetsentry:masterfrom
xeash:pr/fix_sentry__path_create_dir_all_win
Closed

fix bug with absolute database path on windows#276
xeash wants to merge 3 commits intogetsentry:masterfrom
xeash:pr/fix_sentry__path_create_dir_all_win

Conversation

@xeash
Copy link
Copy Markdown

@xeash xeash commented Jun 5, 2020

If you on windows and set sentry_options_set_database_path to absolute path , then sentry__path_create_dir_all will fail horribly, because it dont skip drive letter path component.

In my case, I just want to set database to windows temp dir, because I dont have write permissions to program folder.

Interesting note, that I failed to find this bug at first, because I set path with back slashes like
c:/Users/<USERNAME>/AppData/Local/Temp/sentry-db-directory/ and sentry__path_create_dir_all will successfully create folder, but then it calls sentry__path_absolute that normalize it to forward slashes c:\\Users\\<USERNAME>\\AppData\\Local\\Temp\\sentry-db-directory\\ and fail on sentry__run_new.

If you set forward slashes from start c:\\Users\\<USERNAME>\\AppData\\Local\\Temp\\sentry-db-directory\\ it fails even creating sentry-db-directory for the same reason.

This patch fixes described problem for me.

@Swatinem
Copy link
Copy Markdown
Contributor

Swatinem commented Jun 5, 2020

lgtm. May be related to #266, and I will defer this to @mitsuhiko

@Swatinem
Copy link
Copy Markdown
Contributor

Thanks for your PR! This was superceded by #289, which seemed like a simpler fix for this.

@Swatinem Swatinem closed this Jun 10, 2020
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

Successfully merging this pull request may close these issues.

2 participants