Open gv74 opened 3 years ago
Sorry, false alarm. It's a samba issue.
On further investigation, most likely is problem in SMBSync2.
As long the user that logon to smb share is the user that own the files on smb share (SAMBA share), delete works fine. But if I tell SAMBA to change the owner/group of files (force user = xxx
and force group = xxx
) delete does not work anymore. Works OK with windows, works with total commander for android.
This is part from SMBSybc2 log:
D I 2021/06/17 10:00:55.079 SyncThread deleteSmbItem entered, del=smb://x.x.x.x/dummy-share/dummy-dir/dummy/
M E 2021/06/17 10:00:55.132 SyncThread [dummy-dir]: local ==> SMB: SMB delete error, Access is denied.
smb://x.x.x.x/dummy-share/dummy-dir/dummy/
M E 2021/06/17 10:00:55.133 SyncThread [dummy-dir]: local ==> SMB: putErrorMessageJcifs From=/storage/0927-726B/dummy-dir/dummy, To=smb://x.x.x.x/dummy-share/dummy-dir/dummy.
M E 2021/06/17 10:00:55.133 SyncThread [dummy-dir]: local ==> SMB: Access is denied..
M E 2021/06/17 10:00:55.134 SyncThread [dummy-dir]: local ==> SMB: NT Status=0xc0000022.
M E 2021/06/17 10:00:55.134 SyncThread [dummy-dir]: local ==> SMB:..
M E 2021/06/17 10:00:55.135 SyncThread [dummy-dir]: local ==> SMB: com.sentaroh.jcifs.JcifsFile.delete(JcifsFile.java:204)
com.sentaroh.android.SMBSync2.SyncThread.deleteSmbFile(SyncThread.java:1915)
com.sentaroh.android.SMBSync2.SyncThread.deleteSmbItem(SyncThread.java:1877)
com.sentaroh.android.SMBSync2.SyncThreadSyncFile.syncDeleteInternalToSmb(SyncThreadSyncFile.java:523)
com.sentaroh.android.SMBSync2.SyncThreadSyncFile.syncDeleteInternalToSmb(SyncThreadSyncFile.java:538)
com.sentaroh.android.SMBSync2.SyncThreadSyncFile.syncMirrorExternalToSmb(SyncThreadSyncFile.java:1941)
com.sentaroh.android.SMBSync2.SyncThread.performSync(SyncThread.java:1430)
com.sentaroh.android.SMBSync2.SyncThread.run(SyncThread.java:326).
dummy
directory can be deleted from Windows using the same user and password. Same for Total Commander for Android.
If only force group = xxx
is used, delete also works.
Hi,
It looks like an error because the group to which the account used by SMBSync2 belongs has not been assigned delete permission. Review the access authority assignment.
Best regards.
Hi.
Like I said, I can delete the very same files from windows using the same user and password. There is nothing wrong with access rights on the SMB share.
Regards.
Hi,
No error occurred when "force group = users" was specified.
[share] comment = Samba share path = /share create mode = 0777 directory mode = 0777 browseable = yes read only = no guest ok = no force group = users
Best regards.
Try this config:
[android-backup]
path = /opt/android-backup
browseable = yes
writable = yes
printable = no
public = no
guest only = no
guest ok = no
;create mask = 0660
;directory mask = 0770
force user = user1
force group = user1
valid users = android-backup
You authenticate as android-backup
and files are owned by user1
.
Thank you.
$ rpm -q samba
samba-4.13.3-3.el8.x86_64
$ cat /etc/redhat-release
CentOS Linux release 8.4.2105
Hi,
I tested it with your settings, but no error occurred.
-Ubuntu 18.04.5 LTS -Samba 4.7.6
service smbd stop sudo adduser user1 sudo adduser android-backup sudo pdbedit -a user1 sudo pdbedit -a android-backup sudo mkdir /opt/android-backup sudo chown user1 /opt/android-backup sudo chgrp user1 /opt/android-backup service smbd start
-Copy to SAMBA
-Delete from SAMBA
Best regards.
OK. Thank you.
Tested with SMBSync2 2.52 and 2.54. Files and directories on remote smb share can be removed using other tools.