You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.")
The text was updated successfully, but these errors were encountered:
I noticed that fd.writable was returning true when a file was opened with 'rb'.
The print line was printed and fd.write resulted in an exception.
The following works for the purpose.
The text was updated successfully, but these errors were encountered: