After boot or after systemctl restart smb
Samba cannot execute chown, as shown in the log line.
Basically, when I am user2 and upload a file into /home/user1 the expected behaviour is that the file owner will be user1. However, it stays user2 since AppArmor blocks smbd from changing ownership (see log).
I found out that it works, after I disable and re-enable the AppArmor-profile. Thus, I can tell it is related to AppArmor.
Thanks for your advise, which worked! That’s what I’ve done.
-
cp /usr/lib/systemd/system/smb.service /etc/systemd/system/
-
Add into section [service]
ExecStartPost=/usr/sbin/aa-disable /usr/sbin/smbd
ExecStartPost=/usr/sbin/aa-enforce /usr/sbin/smbd
systemctl daemon-reload
However, I would be interested in fixing the root cause!!