[Qemu-devel] [PATCH v4 0/1] 9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes

Tobias Schramm posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170619142848.14258-1-tobleminer@gmail.com
Test FreeBSD passed
There is a newer version of this series
fsdev/file-op-9p.h      |  4 ++++
fsdev/qemu-fsdev-opts.c | 12 ++++++++++++
hw/9pfs/9p-local.c      | 34 +++++++++++++++++++++++++---------
hw/9pfs/9p.c            |  3 +++
qemu-options.hx         | 20 ++++++++++++++++----
5 files changed, 60 insertions(+), 13 deletions(-)
[Qemu-devel] [PATCH v4 0/1] 9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes
Posted by Tobias Schramm 6 years, 10 months ago
Hi,

i've noticed that there is no way to control the permissions of newly created files and
folders on the host when using 9p in mapped security mode. This can be a big problem when
configuring permissions for access to such data for groups and via ACLs on the host.
Thus I added the options fmode and dmode to the fsdev and virtfs options that set the actual
permissions of newly created files and folders on the host.

This version of the patch fixes the back to front "mask" naming in the previous patches. I
always meant "mode" when actually writing "mask".

Also specifying fmode and dmode only has an effect in mapped security modes. Specifying it
in any other mode now throws an error.

Additionally I've switched fmode and dmode to QEMU_OPT_NUMBER because it handels octal input
just fine.

Also previous versions leaked a string with g_strdup if an error during parsing of fmode/dmode
occurred.

Thanks to Greg Kurz for pointing out most of the above issues to me.

Tobias Schramm

Tobias Schramm (1):
  Add support for custom fmode/dmode in 9ps mapped security modes

 fsdev/file-op-9p.h      |  4 ++++
 fsdev/qemu-fsdev-opts.c | 12 ++++++++++++
 hw/9pfs/9p-local.c      | 34 +++++++++++++++++++++++++---------
 hw/9pfs/9p.c            |  3 +++
 qemu-options.hx         | 20 ++++++++++++++++----
 5 files changed, 60 insertions(+), 13 deletions(-)

-- 
2.13.1


Re: [Qemu-devel] [PATCH v4 0/1] 9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes
Posted by Greg Kurz 6 years, 10 months ago
On Mon, 19 Jun 2017 16:28:47 +0200
Tobias Schramm <tobleminer@gmail.com> wrote:

> Hi,
> 
> i've noticed that there is no way to control the permissions of newly created files and
> folders on the host when using 9p in mapped security mode. This can be a big problem when
> configuring permissions for access to such data for groups and via ACLs on the host.
> Thus I added the options fmode and dmode to the fsdev and virtfs options that set the actual
> permissions of newly created files and folders on the host.
> 
> This version of the patch fixes the back to front "mask" naming in the previous patches. I
> always meant "mode" when actually writing "mask".
> 

Indeed, this hasn't the umask semantics.

> Also specifying fmode and dmode only has an effect in mapped security modes. Specifying it
> in any other mode now throws an error.
> 
> Additionally I've switched fmode and dmode to QEMU_OPT_NUMBER because it handels octal input
> just fine.
> 
> Also previous versions leaked a string with g_strdup if an error during parsing of fmode/dmode
> occurred.
> 
> Thanks to Greg Kurz for pointing out most of the above issues to me.
> 
> Tobias Schramm
> 
> Tobias Schramm (1):
>   Add support for custom fmode/dmode in 9ps mapped security modes
> 
>  fsdev/file-op-9p.h      |  4 ++++
>  fsdev/qemu-fsdev-opts.c | 12 ++++++++++++
>  hw/9pfs/9p-local.c      | 34 +++++++++++++++++++++++++---------
>  hw/9pfs/9p.c            |  3 +++
>  qemu-options.hx         | 20 ++++++++++++++++----
>  5 files changed, 60 insertions(+), 13 deletions(-)
>