-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
I noticed that fd.writable was returning true when a file was opened with 'rb'.
with smbclient.open_file(file, 'rb') as fd:
if fd.writable:
print(" [x] The above file is writable by the smbuser passed.")
fd.write("test")
The print line was printed and fd.write resulted in an exception.
The following works for the purpose.
try:
with smbclient.open_file(file,'w') as fdw:
print(" [x] The above file is writable by the smbuser passed.")
except:
print(" [ ] No write access to above file.")
Metadata
Metadata
Assignees
Labels
No labels