diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2016-02-06 09:40:53 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2016-02-06 09:40:53 +0100 |
commit | 47bc8f54f39837555e0a13593d08b64df88e2877 (patch) | |
tree | ed7a401fb6588b30df11765956380e112c59d3de | |
parent | 5942ea98a288acfdbd6b8d5d21fe22c8aa1ac6dd (diff) | |
download | libgphoto2-47bc8f54f39837555e0a13593d08b64df88e2877.tar.gz |
if a fuse filesystem is backed by a /dev/ device, allow it
This will help exfat users hopefully.
https://github.com/gphoto/libgphoto2/issues/39
-rw-r--r-- | libgphoto2_port/disk/disk.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libgphoto2_port/disk/disk.c b/libgphoto2_port/disk/disk.c index f5fc0df0c..f38764f88 100644 --- a/libgphoto2_port/disk/disk.c +++ b/libgphoto2_port/disk/disk.c @@ -115,23 +115,29 @@ gp_port_library_list (GPPortInfoList *list) (NULL != strstr(mntent->mnt_fsname,"devtmpfs"))|| (NULL != strstr(mntent->mnt_fsname,"devpts"))|| (NULL != strstr(mntent->mnt_fsname,"sysfs"))|| - (NULL != strstr(mntent->mnt_fsname,"gphotofs")|| + (NULL != strstr(mntent->mnt_fsname,"gphotofs"))|| /* fstype based */ (NULL != strstr(mntent->mnt_type,"autofs")) || (NULL != strstr(mntent->mnt_type,"nfs")) || (NULL != strstr(mntent->mnt_type,"smbfs"))|| (NULL != strstr(mntent->mnt_type,"proc"))|| (NULL != strstr(mntent->mnt_type,"sysfs"))|| - (NULL != strstr(mntent->mnt_type,"fuse"))|| (NULL != strstr(mntent->mnt_type,"cifs"))|| (NULL != strstr(mntent->mnt_type,"afs")) || /* mount options */ /* x-systemd.automount or similar */ (NULL != strstr(mntent->mnt_opts,"automount")) -) ) { continue; } + + /* Whitelist some fuse based filesystems, e.g. to help exfat mounts */ + /* In general, if we are backed by a device, it is probably good(tm) */ + if (NULL != strstr(mntent->mnt_type,"fuse")) { + if (!strstr(mntent->mnt_fsname,"/dev/")) + continue; + } + snprintf (path, sizeof(path), "%s/DCIM", mntent->mnt_dir); if (-1 == stat(path, &stbuf)) { snprintf (path, sizeof(path), "%s/dcim", mntent->mnt_dir); @@ -186,7 +192,6 @@ gp_port_library_list (GPPortInfoList *list) (NULL != strstr(mntent->mnt_type,"smbfs"))|| (NULL != strstr(mntent->mnt_type,"proc"))|| (NULL != strstr(mntent->mnt_type,"sysfs"))|| - (NULL != strstr(mntent->mnt_type,"fuse"))|| (NULL != strstr(mntent->mnt_type,"cifs"))|| (NULL != strstr(mntent->mnt_type,"afs")) || /* options */ @@ -194,6 +199,12 @@ gp_port_library_list (GPPortInfoList *list) ) { continue; } + /* Whitelist some fuse based filesystems, e.g. to help exfat mounts */ + /* In general, if we are backed by a device, it is probably good(tm) */ + if (NULL != strstr(mntent->mnt_type,"fuse")) { + if (!strstr(mntent->mnt_fsname,"/dev/")) + continue; + } snprintf (path, sizeof(path), "%s/DCIM", mntent->mnt_dir); if (-1 == stat(path, &stbuf)) { |