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

File download fails if the file is marked as malware in OneDrive #153

Closed
Jojuh opened this issue Aug 29, 2018 · 4 comments
Closed

File download fails if the file is marked as malware in OneDrive #153

Jojuh opened this issue Aug 29, 2018 · 4 comments
Labels
Bug Something isn't working Fixed
Milestone

Comments

@Jojuh
Copy link

Jojuh commented Aug 29, 2018

Bug Report Details

Describe the bug
If the file is marked as possible malware in OneDrive for Business, the file download fails in the synchronization, preventing further actions.

Application and Operating System Details:

  • OS: Linux jojuh-pc 4.4.0-131-generic Asynchronous operation #157-Ubuntu SMP Thu Jul 12 15:51:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Application version: onedrive v2.1.2
  • OneDrive Account Type: OneDrive for Business (Office365 Business)
  • DMD64 D Compiler v2.081.1

To Reproduce
Steps to reproduce the behavior if not causing an application crash:

  1. Have file marked malware in OneDrive for Business folders (for example EICAR as eicar.com)
  2. Run onedrive --synchronize
  3. Tries to download the file three times, then fails with error "No such file or directory", cannot skip/continue to other files

Complete Verbose Log Output

juha@jojuh-pc ~ $ onedrive --synchronize --verbose
Loading config ...
Using Config Dir: /home/juha/.config/onedrive
No config file found, using defaults
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /home/juha/OneDrive
Initializing the Synchronization Engine ...
Account Type: business
Default Drive ID: b!TQCdbdAI60KhQhKcssKuwdJ3RNnKuKRKnwgsjL4FeRSoPW59h23QT4Hn-pbQzx2d
Default Root ID: 01UKNUVNN6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1097104622077
Fetching details for OneDrive Root
OneDrive Root exists in the database
Syncing changes from OneDrive ...
Applying changes of Path ID: 01UKNUVNN6Y2GOVW7725BZO354PWSELRRZ
The local item is unsynced, renaming
Downloading file eicar.com ... done.
eicar.com: No such file or directory
Syncing changes from OneDrive ...
Applying changes of Path ID: 01UKNUVNN6Y2GOVW7725BZO354PWSELRRZ
The local item is unsynced, renaming
Downloading file eicar.com ... done.
eicar.com: No such file or directory
Syncing changes from OneDrive ...
Applying changes of Path ID: 01UKNUVNN6Y2GOVW7725BZO354PWSELRRZ
The local item is unsynced, renaming
Downloading file eicar.com ... done.
std.file.FileException@/usr/include/dmd/phobos/std/file.d(1554): eicar.com: No such file or directory
----------------
/usr/include/dmd/phobos/std/file.d:274 @trusted bool std.file.cenforce!(bool).cenforce(bool, scope const(char)[], scope const(char)*, immutable(char)[], ulong) [0x572930]
/usr/include/dmd/phobos/std/file.d:263 @safe void std.file.setTimes!(immutable(char)[]).setTimes(immutable(char)[], std.datetime.systime.SysTime, std.datetime.systime.SysTime) [0x5820c6]
src/sync.d:681 void sync.SyncEngine.downloadFileItem(itemdb.Item, immutable(char)[]) [0x5b44cc]
src/sync.d:600 void sync.SyncEngine.applyNewItem(itemdb.Item, immutable(char)[]) [0x5b3ecf]
src/sync.d:574 void sync.SyncEngine.applyDifference(std.json.JSONValue, immutable(char)[], bool) [0x5b3d7b]
src/sync.d:437 void sync.SyncEngine.applyDifferences(immutable(char)[], const(char)[]) [0x5b3297]
src/sync.d:201 void sync.SyncEngine.applyDifferences() [0x5b2385]
src/main.d:421 void main.performSync(sync.SyncEngine, immutable(char)[], bool, bool, bool) [0x597ca6]
src/main.d:289 _Dmain [0x59752f]

Additional context
Have not tried with OneDrive Personal account, is there a malware detection present. Can provide any further information if necessary.

abraunegg added a commit that referenced this issue Aug 29, 2018
* Initial debugging for Issue #153
@abraunegg abraunegg added Bug Something isn't working In Progress Currently being worked on labels Aug 29, 2018
@abraunegg
Copy link
Owner

abraunegg commented Sep 2, 2018

@Jojuh
Can you help validate the following PR which should resolve your issue:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/155/head:pr155
git checkout pr155
make
make install

Local validation of fix:

Loading config ...
Using Config Dir: /root/.config/onedrive
No config file found, using defaults
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: 1099259905301
Fetching details for OneDrive Root
OneDrive Root does not exist in the database. We need to add it.
Added OneDrive Root to the local database
Syncing changes from OneDrive ...
Applying changes of Path ID: <redacted>
Downloading file eicar/eicar_com.zip ... ERROR: MALWARE DETECTED IN FILE - DOWNLOAD SKIPPED
Downloading file eicar/eicar.com ... ERROR: MALWARE DETECTED IN FILE - DOWNLOAD SKIPPED
Downloading file eicar/eicarcom2.zip ... ERROR: MALWARE DETECTED IN FILE - DOWNLOAD SKIPPED
Uploading differences of .
Processing root
The directory has not changed
Processing eicar
The directory has not changed
Processing Document.docx
The file has not changed
Uploading new items of .
Applying changes of Path ID: <redacted>

@abraunegg abraunegg added Waiting on Response and removed In Progress Currently being worked on labels Sep 2, 2018
@Jojuh
Copy link
Author

Jojuh commented Sep 3, 2018

Yes, it seems to skip the file correctly now:

juha@jojuh-pc ~ $ onedrive --synchronize
Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...
Creating directory: test
Downloading file test/eicar.com ... ERROR: MALWARE DETECTED IN FILE - DOWNLOAD SKIPPED

abraunegg added a commit that referenced this issue Sep 12, 2018
…ive (Issue #153) (#155)

* Gracefully handle the situation where OneDrive has marked a file as malware and will not provide the file for download
@abraunegg
Copy link
Owner

PR #155 merged

@lock
Copy link

lock bot commented Jan 5, 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 5, 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