Skip to content

Instantly share code, notes, and snippets.

@dimaryaz
Created August 15, 2018 07:28
Show Gist options
  • Star 42 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save dimaryaz/275f2dacc7ac50cebd33fc0217b5c249 to your computer and use it in GitHub Desktop.
Save dimaryaz/275f2dacc7ac50cebd33fc0217b5c249 to your computer and use it in GitHub Desktop.
Dropbox ext4 hack
/*
* dropbox_ext4.c
*
* Compile like this:
* gcc -shared -fPIC -ldl -o libdropbox_ext4.so dropbox_ext4.c
*
* Run Dropbox like this:
* LD_PRELOAD=./libdropbox_ext4.so ~/.dropbox-dist/dropboxd
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <sys/vfs.h>
#include <linux/magic.h>
#include <dlfcn.h>
int (*orig_statfs)(const char *path, struct statfs64 *buf) = NULL;
int statfs64(const char *path, struct statfs64 *buf) {
if (orig_statfs == NULL) {
orig_statfs = dlsym(RTLD_NEXT, "statfs64");
}
int retval = orig_statfs(path, buf);
if (retval == 0) {
buf->f_type = EXT4_SUPER_MAGIC;
}
return retval;
}
@sanmai
Copy link

sanmai commented Aug 16, 2018

Could this be made a proper repository? So there could be a Makefile, README, and a proper release. Thank you.

@Drudenhaus
Copy link

+1 to sanmai's suggestion!

@dimaryaz
Copy link
Author

@dark
Copy link

dark commented Sep 3, 2018

I borrowed this code to create a slightly different startup script: https://github.com/dark/dropbox-filesystem-fix

@petersaints
Copy link

I prefer dark's approach because I don't have Dropbox installed system wide. It's only on the ~/.dropbox-dist folder. So I'm using the code from his repository. I already had a symlink on my ~/bin pointing to ~/.dropbox-dist/dropboxd. That was what I used to launch dropbox, so now I just point to my local copy of dropbox_start.py and voilá... No more unsupported filesystem warning.

@lilydjwg
Copy link

This doesn't work for me. I'm going to uninstall Dropbox instead.

@txdv
Copy link

txdv commented Feb 18, 2019

@sanmai you can fork gists and add multiple files to it...

@otherguy
Copy link

@dimaryaz Have you figured out a way how to do that with newer clients?

Traceback (most recent call last):
  File "dropbox/client/main.pyc", line 831, in wrapper
  File "dropbox/client/main.pyc", line 7009, in finish_dropbox_boot
  File "dropbox/client/main.pyc", line 6446, in _init_components_for_account
  File "dropbox/client/main.pyc", line 6397, in create_sync_engine
  File "dropbox/sync_engine_boundary/factory.pyc", line 348, in make_sync_engine
  File "dropbox/sync_engine/nucleus/classic_client/sync_engine.pyc", line 379, in __init__
  File "dropbox/sync_engine/nucleus/classic_client/thin_adapter/in_proc.pyc", line 251, in __init__
  File "dropbox/sync_engine/nucleus/classic_client/thin_adapter/in_proc.pyc", line 601, in _init_new_engine_locked
  File "dropbox/sync_engine/nucleus/thin_client/client.pyc", line 144, in __init__
  File "extensions/nucleus/nucleus_python.pyx", line 84, in nucleus_python.NucleusSyncEngine.__cinit__
nucleus_python.SyncEngineError: Initializing engine |>> Initializing platform |>> Checking if filesystem is supported |>> Filesystem is not supported: "FUSE"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment