[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/9pfs: Use O_NOFOLLOW when opening files on s
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] hw/9pfs: Use O_NOFOLLOW when opening files on server |
Date: |
Wed, 22 May 2013 16:54:55 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, May 22, 2013 at 04:52:54PM +0530, Aneesh Kumar K.V wrote:
> diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c
> index fe8e0ed..e2a89e3 100644
> --- a/hw/9pfs/virtio-9p-handle.c
> +++ b/hw/9pfs/virtio-9p-handle.c
> @@ -608,7 +608,7 @@ static int handle_init(FsContext *ctx)
> struct file_handle fh;
> struct handle_data *data = g_malloc(sizeof(struct handle_data));
>
> - data->mountfd = open(ctx->fs_root, O_DIRECTORY);
> + data->mountfd = open(ctx->fs_root, O_DIRECTORY | O_NOFOLLOW);
Why is the root path not allowed to be a symlink?
And if so, it would be more user-friendly to resolve the path before
open. That way we don't need to bug the user with an error here.