File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -645,20 +645,22 @@ def ls(self):
645645 self .logger .fail ("No root escape possible, please specify a share" )
646646 return
647647
648- # Update UID and GID for the share
649- self .update_auth (mount_fh )
650-
651648 # We got a path to look up
652649 curr_fh = mount_fh
653650 is_file = False # If the last path is a file
654651
655652 # If ls is "" or "/" without filter we would get one item with [""]
656653 for sub_path in list (filter (None , self .args .ls .split ("/" ))):
654+ # Update UID and GID for the path
655+ self .update_auth (curr_fh )
657656 res = self .nfs3 .lookup (curr_fh , sub_path , auth = self .auth )
658657
659658 if "resfail" in res and res ["status" ] == NFS3ERR_NOENT :
660659 self .logger .fail (f"Unknown path: { self .args .ls !r} " )
661660 return
661+ elif "resfail" in res :
662+ self .logger .fail (f"Error on looking up path '{ sub_path } ': { NFSSTAT3 [res ['status' ]]} " )
663+ return
662664 # If file then break and only display file
663665 if res ["resok" ]["obj_attributes" ]["attributes" ]["type" ] == NF3REG :
664666 is_file = True
You can’t perform that action at this time.
0 commit comments