From: Aneesh Kumar K.V Date: Thu, 2 Sep 2010 05:39:07 +0000 (+0530) Subject: virtio-9p: Use lchown which won't follow symlink X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~7225 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c0f255dd4c8b8f3349b6ed14233f77948c5a9a6;p=sdk%2Femulator%2Fqemu.git virtio-9p: Use lchown which won't follow symlink We should always use functions which don't follow symlink on the server Signed-off-by: Aneesh Kumar K.V --- diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c index 58e7647..132816e 100644 --- a/hw/virtio-9p-local.c +++ b/hw/virtio-9p-local.c @@ -101,7 +101,7 @@ static int local_post_create_passthrough(FsContext *fs_ctx, const char *path, if (chmod(rpath(fs_ctx, path), credp->fc_mode & 07777) < 0) { return -1; } - if (chown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid) < 0) { + if (lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid) < 0) { /* * If we fail to change ownership and if we are * using security model none. Ignore the error