- 当使用python 2.7 shutil以root身份从linux写入cifs共享时,没有问题
- 当使用cp作为普通用户手动编写文件时,没有问题
- 当使用python shutil.copy或copy2作为普通用户时:
File "/usr/lib64/python2.7/shutil.py", line 120, in copy
copymode(src, dst)
File "/usr/lib64/python2.7/shutil.py", line 91, in copymode
os.chmod(dst, mode)
OSError: [Errno 1] Operation not permitted: '/mnt/RW_H-drive/file.csv
答案 0 :(得分:1)
示例:
//nasx/sharex/ /mnt/RW_H-drive/ cifs credentials=/root/smbcredentials,_netdev,uid=4321 0 0
而不是:
//nasx/sharex/ /mnt/RW_H-drive/ cifs credentials=/root/smbcredentials,_netdev,file_mode=0777,dir_mode=0777 0 0