Revision f7613bee hw/virtio-9p.c

b/hw/virtio-9p.c
209 209

  
210 210
static int v9fs_do_chown(V9fsState *s, V9fsString *path, uid_t uid, gid_t gid)
211 211
{
212
    return s->ops->chown(&s->ctx, path->data, uid, gid);
212
    FsCred cred;
213
    cred_init(&cred);
214
    cred.fc_uid = uid;
215
    cred.fc_gid = gid;
216

  
217
    return s->ops->chown(&s->ctx, path->data, &cred);
213 218
}
214 219

  
215 220
static int v9fs_do_utime(V9fsState *s, V9fsString *path,
......
2014 2019
        goto out;
2015 2020
    }
2016 2021

  
2017
    if (vs->v9stat.n_gid != -1) {
2022
    if (vs->v9stat.n_gid != -1 || vs->v9stat.n_uid != -1) {
2018 2023
        if (v9fs_do_chown(s, &vs->fidp->path, vs->v9stat.n_uid,
2019 2024
                    vs->v9stat.n_gid)) {
2020 2025
            err = -errno;

Also available in: Unified diff