Skip to content

Commit 812c277

Browse files
authored
Merge pull request Pennyw0rth#724 from Pennyw0rth/neff-add-ls-check
Add error handling if we can't mount share with --ls
2 parents 9f7c35c + cdecf3f commit 812c277

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

nxc/protocols/nfs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,11 @@ def ls(self):
622622
# NORMAL LS CALL (without root escape)
623623
if self.args.share:
624624
mount_info = self.mount.mnt(self.args.share, self.auth)
625-
mount_fh = mount_info["mountinfo"]["fhandle"]
625+
if mount_info["status"] != 0:
626+
self.logger.fail(f"Could not mount share {self.args.share}: {NFSSTAT3[mount_info['status']]}")
627+
return
628+
else:
629+
mount_fh = mount_info["mountinfo"]["fhandle"]
626630
elif self.root_escape:
627631
# Interestingly we don't actually have to mount the share if we already got the handle
628632
self.logger.success(f"Successful escape on share: {self.escape_share}")

0 commit comments

Comments
 (0)