Revision 879c2813 hw/virtio-9p.c
b/hw/virtio-9p.c | ||
---|---|---|
199 | 199 |
return s->ops->open2(&s->ctx, vs->fullname.data, flags, &cred); |
200 | 200 |
} |
201 | 201 |
|
202 |
static int v9fs_do_symlink(V9fsState *s, V9fsString *oldpath, |
|
203 |
V9fsString *newpath) |
|
202 |
static int v9fs_do_symlink(V9fsState *s, V9fsCreateState *vs) |
|
204 | 203 |
{ |
205 |
return s->ops->symlink(&s->ctx, oldpath->data, newpath->data); |
|
204 |
FsCred cred; |
|
205 |
cred_init(&cred); |
|
206 |
cred.fc_uid = vs->fidp->uid; |
|
207 |
cred.fc_mode = vs->perm | 0777; |
|
208 |
|
|
209 |
return s->ops->symlink(&s->ctx, vs->extension.data, vs->fullname.data, |
|
210 |
&cred); |
|
206 | 211 |
} |
207 | 212 |
|
208 | 213 |
static int v9fs_do_link(V9fsState *s, V9fsString *oldpath, V9fsString *newpath) |
... | ... | |
1785 | 1790 |
err = v9fs_do_mkdir(s, vs); |
1786 | 1791 |
v9fs_create_post_mkdir(s, vs, err); |
1787 | 1792 |
} else if (vs->perm & P9_STAT_MODE_SYMLINK) { |
1788 |
err = v9fs_do_symlink(s, &vs->extension, &vs->fullname);
|
|
1793 |
err = v9fs_do_symlink(s, vs);
|
|
1789 | 1794 |
v9fs_create_post_perms(s, vs, err); |
1790 | 1795 |
} else if (vs->perm & P9_STAT_MODE_LINK) { |
1791 | 1796 |
int32_t nfid = atoi(vs->extension.data); |
Also available in: Unified diff