- if (*((char *)&(rpc_pkt.u.reply.data[2])) != '/') {
- int pathlen;
- strcat(nfs_path, "/");
- pathlen = strlen(nfs_path);
- memcpy(nfs_path + pathlen, (uchar *)&(rpc_pkt.u.reply.data[2]),
- rlen);
- nfs_path[pathlen + rlen] = 0;
- } else {
- memcpy(nfs_path, (uchar *)&(rpc_pkt.u.reply.data[2]), rlen);
- nfs_path[rlen] = 0;
+ rlen = ntohl(rpc_pkt.u.reply.data[1]); /* new path length */
+
+ if (*((char *)&(rpc_pkt.u.reply.data[2])) != '/') {
+ int pathlen;
+ strcat(nfs_path, "/");
+ pathlen = strlen(nfs_path);
+ memcpy(nfs_path + pathlen,
+ (uchar *)&(rpc_pkt.u.reply.data[2]),
+ rlen);
+ nfs_path[pathlen + rlen] = 0;
+ } else {
+ memcpy(nfs_path,
+ (uchar *)&(rpc_pkt.u.reply.data[2]),
+ rlen);
+ nfs_path[rlen] = 0;
+ }
+ } else { /* NFSV3_FLAG */
+ int nfsv3_data_offset = 0;
+ if (ntohl(rpc_pkt.u.reply.data[1]) != 0) {
+ /* 'attributes_follow' flag is TRUE,
+ * so we have attributes on 21 bytes */
+ /* Skip unused values :
+ type; 32 bits value,
+ mode; 32 bits value,
+ nlink; 32 bits value,
+ uid; 32 bits value,
+ gid; 32 bits value,
+ size; 64 bits value,
+ used; 64 bits value,
+ rdev; 64 bits value,
+ fsid; 64 bits value,
+ fileid; 64 bits value,
+ atime; 64 bits value,
+ mtime; 64 bits value,
+ ctime; 64 bits value,
+ */
+ nfsv3_data_offset = 22;
+ } else {
+ /* 'attributes_follow' flag is FALSE,
+ * so we don't have any attributes */
+ nfsv3_data_offset = 1;
+ }
+
+ /* new path length */
+ rlen = ntohl(rpc_pkt.u.reply.data[1+nfsv3_data_offset]);
+
+ if (*((char *)&(rpc_pkt.u.reply.data[2+nfsv3_data_offset])) != '/') {
+ int pathlen;
+ strcat(nfs_path, "/");
+ pathlen = strlen(nfs_path);
+ memcpy(nfs_path + pathlen,
+ (uchar *)&(rpc_pkt.u.reply.data[2+nfsv3_data_offset]),
+ rlen);
+ nfs_path[pathlen + rlen] = 0;
+ } else {
+ memcpy(nfs_path,
+ (uchar *)&(rpc_pkt.u.reply.data[2+nfsv3_data_offset]),
+ rlen);
+ nfs_path[rlen] = 0;
+ }