X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs.c;h=c322c377b15d5a858da2e084c0e8aeeb03ee11b8;hb=bff8fe460dcf4b25071fff966d86877b30eeec90;hp=93cd62902a081d9fb7d3679e0a3c10011d05bdae;hpb=73f4ae7cca447767dbcf4e574e585be007d3be47;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 93cd629..c322c37 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -27,10 +27,11 @@ #ifdef WIN32 #include "win32_compat.h" -#else -#include +#endif + +#ifdef HAVE_UTIME_H #include -#endif /*WIN32*/ +#endif #ifdef ANDROID #define statvfs statfs @@ -50,6 +51,14 @@ #include #endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + +#ifdef HAVE_STRINGS_H +#include +#endif + #include #include #include @@ -59,7 +68,6 @@ #include #include #include -#include #include "libnfs-zdr.h" #include "libnfs.h" #include "libnfs-raw.h" @@ -1675,10 +1683,10 @@ static void nfs_create_2_cb(struct rpc_context *rpc, int status, void *command_d } memset(nfsfh, 0, sizeof(struct nfsfh)); - /* steal the filehandle */ - nfsfh->fh.data.data_len = data->fh.data.data_len; - nfsfh->fh.data.data_val = data->fh.data.data_val; - data->fh.data.data_val = NULL; + /* copy the filehandle */ + nfsfh->fh.data.data_len = res->LOOKUP3res_u.resok.object.data.data_len; + nfsfh->fh.data.data_val = malloc(nfsfh->fh.data.data_len); + memcpy(nfsfh->fh.data.data_val, res->LOOKUP3res_u.resok.object.data.data_val, nfsfh->fh.data.data_len); data->cb(0, nfs, nfsfh, data->private_data); free_nfs_cb_data(data);