Skip to content

Commit d214067

Browse files
committed
Fix exception when it is not possible to list share
1 parent 9161b29 commit d214067

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

nxc/protocols/nfs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,10 @@ def try_root_escape(self) -> bool:
590590
self.logger.debug(f"Trying root escape on shares: {shares}")
591591
for share in shares:
592592
mount_info = self.mount.mnt(share, self.auth)
593+
if mount_info["status"] != 0:
594+
self.logger.debug(f"Root escape: can't list directory {share}: {NFSSTAT3[mount_info['status']]}")
595+
self.mount.umnt(self.auth)
596+
continue
593597
mount_fh = mount_info["mountinfo"]["fhandle"]
594598
try:
595599
possible_root_fhs = self.get_root_handles(mount_fh)

0 commit comments

Comments
 (0)