List Info

Thread: Re: file permission problem.




Re: file permission problem.
country flaguser name
France
2008-03-09 13:51:28
Hi Brian,

> Message du 09/03/08 01:49
> De : "Brian Wang" <ywang221hotmail.com>
> A : fuse-devellists.sourceforge.net
> Copie à : 
> Objet : [fuse-devel] file permission problem.
> 

 
> 
> Now, my question is: how do I mount a fuse file system
accessible by a
> non-root user but when that user creates files,
"ls" will show that user as
> the owner?
> 


When creating a file, you have to store its owner, group
and permission into your file system, and return them
when gettattr() gets called.

You may know the effective uid and gid of the process for
which fuse called your file system by :
fuse_get_context()->uid,
and fuse_get_context()->gid

You will also use these when checking for rights to access
a file... but as yet, fuse does not provide you with the
list
of supplementary groups for a full check.

Regards

Jean-Pierre
 
> 
>  
> 
> Thanks
> 
>  
> 
> Brian
> 
>
------------------------------------------------------------
-------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> fuse-devel mailing list
> fuse-devellists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
> 
> 



------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
fuse-devel mailing list
fuse-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Re: file permission problem.
country flaguser name
United States
2008-03-09 14:05:17
Thanks to everyone for the replies.

Now I see the example doesn't implement those.

One more qustion. If "default_permissions" is used
for the mount, would fuse 
enforce the permission check in the kernel?  I am just
wondering if 
"default_permissions"+a"allow_other" is
for the purpose. Assume when mknod 
or mkdir is called, the uid and gid are set correctly, would
the subsequent 
calls (e.g. open/chown...... and other access calls) be
checked against 
permissions by fuse or the check has to be implemented on
user land, which 
is too expensive especially when hook up with NFS.

Thanks again

Brian

----- Original Message ----- 
From: "Jean-Pierre ANDRE"
<jean-pierre.andrewanadoo.fr>
To: "Brian Wang" <ywang221hotmail.com>; <fuse-devellists.sourceforge.net>
Sent: Sunday, March 09, 2008 12:51 PM
Subject: re: [fuse-devel] file permission problem.


Hi Brian,

> Message du 09/03/08 01:49
> De : "Brian Wang" <ywang221hotmail.com>
> A : fuse-devellists.sourceforge.net
> Copie à :
> Objet : [fuse-devel] file permission problem.
>


>
> Now, my question is: how do I mount a fuse file system
accessible by a
> non-root user but when that user creates files,
"ls" will show that user 
> as
> the owner?
>


When creating a file, you have to store its owner, group
and permission into your file system, and return them
when gettattr() gets called.

You may know the effective uid and gid of the process for
which fuse called your file system by :
fuse_get_context()->uid,
and fuse_get_context()->gid

You will also use these when checking for rights to access
a file... but as yet, fuse does not provide you with the
list
of supplementary groups for a full check.

Regards

Jean-Pierre

>
>
>
> Thanks
>
>
>
> Brian
>
>
------------------------------------------------------------
-------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> fuse-devel mailing list
> fuse-devellists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
>
>




------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
fuse-devel mailing list
fuse-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Re: file permission problem.
country flaguser name
Hungary
2008-03-10 02:32:51
> Now I see the example doesn't implement those.
> 
> One more qustion. If "default_permissions" is
used for the mount, would fuse 
> enforce the permission check in the kernel?  I am just
wondering if 
>
"default_permissions"+a"allow_other" is
for the purpose. Assume when mknod 
> or mkdir is called, the uid and gid are set correctly,
would the subsequent 
> calls (e.g. open/chown...... and other access calls) be
checked against 
> permissions by fuse

Yes, "default_permissions" will check the
permission bits in the file
mode, just like any other filesystem.

Miklos

------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
fuse-devel mailing list
fuse-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )