#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <netinet/in.h>
+#include "libnfs-zdr.h"
#include "libnfs.h"
#include "libnfs-raw.h"
#include "libnfs-raw-mount.h"
static int nfs_lookup_path_async_internal(struct nfs_context *nfs, struct nfs_cb_data *data, struct nfs_fh3 *fh);
-void nfs_set_auth(struct nfs_context *nfs, AUTH *auth)
+void nfs_set_auth(struct nfs_context *nfs, struct AUTH *auth)
{
rpc_set_auth(nfs->rpc, auth);
}
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);
*/
uint64_t nfs_get_writemax(struct nfs_context *nfs)
{
- /* Some XDR libraries can not marshall PDUs bigger than this */
+ /* Some ZDR libraries can not marshall PDUs bigger than this */
if (nfs->writemax < 32768) {
return nfs->writemax;
}
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;
+}