qemu-devel
[Top][All Lists]
Advanced

[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: Aneesh Kumar K.V
Subject: Re: [Qemu-devel] [PATCH] hw/9pfs: Use O_NOFOLLOW when opening files on server
Date: Thu, 23 May 2013 13:54:43 +0530
User-agent: Notmuch/0.15.2+52~gb714a80 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

Stefan Hajnoczi <address@hidden> writes:

> 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?

No specific reason. 

>
> 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.

I will drop that hunk.

-aneesh




reply via email to

[Prev in Thread] Current Thread [Next in Thread]