X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibnfs.c;h=86ff7c22d8e33a0d1c50a5e2ad057983fb3ec791;hb=ac559609a3893e80cd7390f0c6c9ab10ae1ca635;hp=118f1d4f3e612caf3094d7a9e0b493d417171eef;hpb=16104b27bd8deedc07a23aec33b4ef3cde82808f;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 118f1d4..86ff7c2 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -2946,8 +2946,17 @@ static void nfs_symlink_cb(struct rpc_context *rpc _U_, int status, void *comman static int nfs_symlink_continue_internal(struct nfs_context *nfs, struct nfs_cb_data *data) { struct nfs_symlink_data *symlink_data = data->continue_data; + SYMLINK3args sa; - if (rpc_nfs_symlink_async(nfs->rpc, nfs_symlink_cb, &data->fh, symlink_data->newpathobject, symlink_data->oldpath, data) != 0) { + memset(&sa, 0, sizeof(SYMLINK3args)); + sa.where.dir.data.data_len = data->fh.data.data_len; + sa.where.dir.data.data_val = data->fh.data.data_val; + sa.where.name = symlink_data->newpathobject; + sa.symlink.symlink_attributes.mode.set_it = 1; + sa.symlink.symlink_attributes.mode.set_mode3_u.mode = S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH; + sa.symlink.symlink_data = symlink_data->oldpath; + + if (rpc_nfs_symlink_async(nfs->rpc, nfs_symlink_cb, &sa, data) != 0) { rpc_set_error(nfs->rpc, "RPC error: Failed to send SYMLINK call for %s", data->path); data->cb(-ENOMEM, nfs, rpc_get_error(nfs->rpc), data->private_data); free_nfs_cb_data(data); @@ -3538,3 +3547,7 @@ const char *nfs_get_export(struct nfs_context *nfs) { const struct nfs_fh3 *nfs_get_rootfh(struct nfs_context *nfs) { return &nfs->rootfh; } + +struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh) { + return &nfsfh->fh; +}