On 08/27/2013 06:28 PM, Fabrice Bauzac wrote:
> From what I understood:
> To create (mount) a FUSE filesystem, you need to communicate with the kernel.
> The way communication is done is the following:
> You open /dev/fuse (which is a character device): open() returns a
> file descriptor.
> You send and receive things (events, responses) via this file descriptor.
> However, to open /dev/fuse and set it up, you need superuser
> privileges (but I don't know the details). So, only root would be
> able to install filesystems and mount them.
> One solution would be to require every FUSE filesystem to be set suid
> root (see http://en.wikipedia.org/wiki/Setuid#setuid_on_executables
> for details on suid executables), so that normal users could mount
> these filesystems. But they still cannot install them (because you
> need to be root to make a suid root executable).
> The solution chosen by FUSE solves both the mount and the install
> requirements. FUSE comes with a suid root program: fusermount. Once
> FUSE is installed, you should have this program suid root. Then
> normal users can create normal filesystems, and obtain access to the
> kernel communication channel through the execution of fusermount. To
> do that, you create a UNIX domain socket, then invoke fusermount as a
> subprocess; this subprocess sets up the communication channel and
> sends the file descriptor back to your process through the socket, and
> then terminates.
> Best regards
> 2013/8/27 Joachim Schiele <js@...>:
>> thanks for enlightenment. maybe you can also explain  a little bit
>> more? it mentiones a socket pair and also the /dev/fuse character
>> device. how does this all work together?
>> On 08/27/2013 05:46 PM, Fox, Kevin M wrote:
>>> It is none of those.
>>> ls -l /dev/fuse
>>> crw-rw-rw-. 1 root root 10, 229 Jul 8 09:34 /dev/fuse
>>> The 'c' on the far left hand side means its a type of file called a character device.
>>> From: Joachim Schiele [js@...]
>>> Sent: Tuesday, August 27, 2013 3:12 AM
>>> To: fuse-devel@...
>>> Subject: [fuse-devel] what is /dev/fuse actually? problem to implement fuse_loop() using Qt4
>>> ===== what is /dev/fuse =====
>>> first of, i've been reading source code of fuse client library 
>>> (fuse.c/helper.c/fuse_loop.c) and the kernel implementation 
>>> (inode.c) and i'm not sure what /dev/fuse is actually, even after
>>> reading  it is not clear to me.
>>> "/dev/fuse" could be:
>>> - unix domain socket
>>> - inet socket
>>> - pipe
>>> - named pipe
>>> - file (see bottom reference of )
>>> > fuse_mount() creates a UNIX domain socket pair, then forks and execs
>>> > fusermount (util/fusermount.c) passing it one end of the socket in the
>>> > FUSE_COMMFD_ENV environment variable.
>>> btw: why do a fork()? please be elaborate here, i will add it to the
>>> documentation if i finally understood it.
>>> my current implementation of fuse_loop(..) works using a socket, see:
>>> - QFuse.cpp line 157 : i associate the QLocalSocket* socket; with the
>>> 'fd' i discovered in fuse_session_receive_buf(..)
>>> this is better illustrated in the bug report  i made.
>>> ===== why is this important to me? =====
>>> i want to:
>>> - implement fuse_loop() using Qt4 methods and later
>>> - implement fuse_loop_mt() using Qt4 methods
>>> but right now i get this weird behaviour. i decided to use the github
>>> bug tracker as it makes it easy for me to write an illustrative guide
>>> using markdown and github magic, please see .
>>> please feel free to answer me using this mail, no need to create a
>>> github account if you don't want to!
>>> i really hope someone can help me. already spent 2 days in reading code
>>> without any outcome.
>>> best wishes,
>>> joachim schiele
>>> ===== links =====
>>>  http://sourceforge.net/p/fuse/fuse/ci/master/tree/lib/fuse.c
>>>  http://sourceforge.net/p/fuse/fuse/ci/master/tree/doc/how-fuse-works
>>>  https://github.com/qknight/qt-fuse-example/issues/1
>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>> Discover the easy way to master current and previous Microsoft technologies
>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>> tutorial videos with LearnDevNow. Subscribe today and save!
>> fuse-devel mailing list