Skip to content

Commit 78da498

Browse files
authored
Merge pull request Pennyw0rth#474 from Pennyw0rth/marshall-nfs-status13-fix
2 parents 3e5d825 + 1b495cd commit 78da498

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

nxc/protocols/nfs.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ def shares(self):
170170
for share, network in zip(shares, networks):
171171
try:
172172
mnt_info = self.mount.mnt(share, self.auth)
173+
self.logger.debug(f"Mounted {share} - {mnt_info}")
174+
if mnt_info["status"] != 0:
175+
self.logger.fail(f"Error mounting share {share}: {NFSSTAT3[mnt_info['status']]}")
176+
continue
173177
file_handle = mnt_info["mountinfo"]["fhandle"]
174178

175179
info = self.nfs3.fsstat(file_handle, self.auth)
@@ -224,7 +228,13 @@ def enum_shares(self):
224228
for share, network in zip(shares, networks):
225229
try:
226230
mount_info = self.mount.mnt(share, self.auth)
227-
contents = self.list_dir(mount_info["mountinfo"]["fhandle"], share, self.args.enum_shares)
231+
self.logger.debug(f"Mounted {share} - {mount_info}")
232+
if mount_info["status"] != 0:
233+
self.logger.fail(f"Error mounting share {share}: {NFSSTAT3[mount_info['status']]}")
234+
continue
235+
236+
fhandle = mount_info["mountinfo"]["fhandle"]
237+
contents = self.list_dir(fhandle, share, self.args.enum_shares)
228238

229239
self.logger.success(share)
230240
if contents:

0 commit comments

Comments
 (0)