hw/9pfs: use O_NOFOLLOW for mapped readlink operation
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 20 May 2013 11:58:29 +0000 (17:28 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 11 Jun 2013 21:45:59 +0000 (16:45 -0500)
commita6fc2cd986e62fc019daf284ee356a4050a44529
tree38a7c504f00d80e9182f3adacb5fd047cd885199
parenteabdf85d86fc90166aa9a866a46ffaf310bf2155
hw/9pfs: use O_NOFOLLOW for mapped readlink operation

With mapped security models like mapped-xattr and mapped-file, we save the
symlink target as file contents. Now if we ever expose a normal directory
with mapped security model and find real symlinks in export path, never
follow them and return proper error.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
(cherry picked from commit aed858ce10ef09c7bdf03f73e75e772f567c74cd)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/9pfs/virtio-9p-local.c