~mati75/spacefm/hand

« back to all changes in this revision

Viewing changes to src/vfs/vfs-volume-nohal.c

  • Committer: IgnorantGuru
  • Date: 2015-03-20 15:08:08 UTC
  • Revision ID: git-v1:84bae9fa242dd1976a0ea1361f227ce26b5ff019
[hand] adjust use of non-block fs blacklist #478

add fuse.gvfsd-fuse to blacklist
protocol handler overrides blacklist
non-blacklist fs shown if mounted in ~/.cache /media/ or /run/media
mount point always must be user-readable

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
#define MOUNTINFO "/proc/self/mountinfo"
51
51
#define MTAB "/proc/mounts"
52
 
#define HIDDEN_NON_BLOCK_FS "devpts proc fusectl pstore sysfs tmpfs devtmpfs ramfs aufs overlayfs cgroup binfmt_misc rpc_pipefs"
 
52
#define HIDDEN_NON_BLOCK_FS "devpts proc fusectl pstore sysfs tmpfs devtmpfs ramfs aufs overlayfs cgroup binfmt_misc rpc_pipefs fuse.gvfsd-fuse"
53
53
 
54
54
void vfs_volume_monitor_start();
55
55
VFSVolume* vfs_volume_read_by_device( struct udev_device *udevice );
2982
2982
    else
2983
2983
    {
2984
2984
        // a non-block device is mounted - do we want to include it?
2985
 
        gboolean keep;
2986
 
        keep = mtab_fstype_is_handled_by_protocol( mtab_fstype );
2987
 
        keep = keep || !strstr( HIDDEN_NON_BLOCK_FS, mtab_fstype );
 
2985
        // is a protocol handler present?
 
2986
        gboolean keep = mtab_fstype_is_handled_by_protocol( mtab_fstype );
 
2987
        if ( !keep && !strstr( HIDDEN_NON_BLOCK_FS, mtab_fstype ) )
 
2988
        {
 
2989
            // no protocol handler and not blacklisted - show anyway?
 
2990
            keep = g_str_has_prefix( point, g_get_user_cache_dir() ) ||
 
2991
                   g_str_has_prefix( point, "/media/" ) ||
 
2992
                   g_str_has_prefix( point, "/run/media/" );
 
2993
        }
 
2994
        // mount point must be readable
2988
2995
        keep = keep && ( geteuid() == 0 || g_access( point, R_OK ) == 0 );
2989
2996
        if ( keep )
2990
2997
        {