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

skip_file config entry needs to be checked for any characters to escape #15

Closed
dawbarton opened this issue Jun 8, 2018 · 7 comments
Closed
Labels
Bug Something isn't working Fixed

Comments

@dawbarton
Copy link

I've just tried the client on another business account (I have two separate businesses, the other one works fine) and I get the error

std.regex.internal.ir.RegexException@/usr/include/dmd/phobos/std/regex/internal/parser.d(1019): '*', '+', '?', '{', '}' not allowed in atom
Pattern with error: `^[^/]*+` <--HERE-- `++[^/]*$`
Pattern with error: `^[^/]*+` <--HERE-- `++[^/]*$`
----------------
/usr/include/dmd/phobos/std/regex/internal/parser.d:1019 pure @trusted void std.regex.internal.parser.Parser!(immutable(char)[], std.regex.internal.parser.CodeGen).Parser.error(immutable(char)[]) [0x542437]
/usr/include/dmd/phobos/std/regex/internal/parser.d:559 ref @trusted std.regex.internal.parser.Parser!(immutable(char)[], std.regex.internal.parser.CodeGen).Parser std.regex.internal.parser.Parser!(immutable(char)[], std.regex.internal.parser.CodeGen).Parser.__ctor!(const(char)[]).__ctor(immutable(char)[], const(char)[]) [0x542826]
/usr/include/dmd/phobos/std/regex/package.d:420 @safe std.regex.internal.ir.Regex!(char).Regex std.regex.regexImpl!(immutable(char)[]).regexImpl(immutable(char)[], const(char)[]) [0x540db2]
/usr/include/dmd/phobos/std/functional.d:1090 std.regex.internal.ir.Regex!(char).Regex std.functional.memoize!(std.regex.regexImpl!(immutable(char)[]).regexImpl(immutable(char)[], const(char)[]), 8).memoize(immutable(char)[], const(char)[]) [0x55b50e]
/usr/include/dmd/phobos/std/regex/package.d:392 @trusted std.regex.internal.ir.Regex!(char).Regex std.regex.regex!(immutable(char)[]).regex(immutable(char)[][], const(char)[]) [0x53fd98]
/usr/include/dmd/phobos/std/regex/package.d:399 @trusted std.regex.internal.ir.Regex!(char).Regex std.regex.regex!(immutable(char)[]).regex(immutable(char)[], const(char)[]) [0x53fc35]
src/util.d:104 std.regex.internal.ir.Regex!(char).Regex util.wild2regex(const(char)[]) [0x5b1ad3]
src/selective.d:27 void selective.SelectiveSync.setMask(const(char)[]) [0x5a570e]
src/main.d:187 _Dmain [0x5935de]

This happens when I paste in the response URI after I've authenticated. It used to work at some point in the past; I checked an old backup and used the refresh_token from that so I didn't need to authenticate again but the same error came up.

Any ideas? Thanks.

@dawbarton
Copy link
Author

I've just realised, I've got skip_file = *+++* in my config (I mark files containing sensitive information with +++ somewhere in the file name so they aren't synced). I guess the + are the offending character in the regex. I've tried escaping it for now (i.e., skip_file = *\+\+\+*) which gets the sync started (it'll take a while to finish and for me to see if it's worked....). It might be worth checking for valid file name characters that need escaping in skip_file.

@abraunegg
Copy link
Owner

The only suggestion I have at this point in time is to work offline with me on this one to determine what the issue is with the account / parsing.

I am testing with OneDrive Business test accounts and don't get a URL parse issue - so i am wondering if it is something environmental / local or account related.

@abraunegg
Copy link
Owner

It might be worth checking for valid file name characters that need escaping

Thanks - will look at this once #2 and #11 are resolved

@abraunegg abraunegg changed the title regex error when connecting to business account skip_file config entry needs to be checked for any characters to escape Jun 8, 2018
@abraunegg
Copy link
Owner

@dawbarton

Just wondering if the approach taken here would work:

JonaMX/onedrive@a45e11c

@abraunegg
Copy link
Owner

@dawbarton
Can you help validate PR #39 ?

Below is my validation:

cat ~/.config/onedrive/config 

skip_file = "*+++*"
Loading config ...
Using Config Dir: /root/.config/onedrive
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /root/OneDrive
Initializing the Synchronization Engine ...
Account Type: business
Default Drive ID: <redacted>
Default Root ID: <redacted>
Remaining Free Space: 1098617079679
Fetching details for OneDrive Root
OneDrive Root exists in the database
Applying changes of Path ID: <redacted>
Uploading differences of .
Processing root
The directory has not changed
Uploading new items of .
Skipping item - excluded by skip_file config: ./sensative-file-+++.doc
Applying changes of Path ID: <redacted>

@abraunegg abraunegg added Fixed and removed In Progress Currently being worked on labels Jun 28, 2018
@dawbarton
Copy link
Author

Thanks! That seems to work for me as well.

abraunegg added a commit that referenced this issue Jun 29, 2018
Fix: skip_file config entry needs to be checked for any characters to escape (Issue #15)
@lock
Copy link

lock bot commented Jan 6, 2019

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

@lock lock bot locked and limited conversation to collaborators Jan 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed
Projects
None yet
Development

No branches or pull requests

2 participants