From b14d5b43f51474b151e64115e4e9e6060e3933e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Notin?= Date: Thu, 26 Sep 2019 19:29:50 +0200 Subject: [PATCH] rpc-scan: handle cases where recurse>=1 but access is denied --- rpc-scan.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpc-scan.py b/rpc-scan.py index 850e82a..4fdb45f 100755 --- a/rpc-scan.py +++ b/rpc-scan.py @@ -75,7 +75,10 @@ def listdir(nfs, auth, file_handle, path, recurse=1): if recurse == 0: return [path + "/"] - items = nfs.readdirplus(file_handle, auth=auth) + try: + items = nfs.readdirplus(file_handle, auth=auth) + except NFSAccessError: + return [] if len(items) == 0: return [path + "/"]