[global] workgroup = example realm = example.test netbios name = server1 server role = active directory domain controller log file = /var/log/samba/smbd.log server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbindd, ntp_signd, kcc, dnsupdate domain logons = Yes wins support = Yes security = user preferred master = auto domain master = yes local master = yes unix extensions = no interfaces = 127.0.0.1 192.168.0.30 bind interfaces only = yes [netlogon] path = /usr/local/samba/var/locks/sysvol/example.test/scripts read only = No browsable = No [sysvol] path = /usr/local/samba/var/locks/sysvol read only = No inherit acls = Yes dos filemode = true force unknown acl user = true browsable = No [profiles] path = /usr/local/samba/var/locks/profiles read only = no create mask = 0600 directory mask = 0700 dos filemode = true browsable = No [share] path = /share read only = No create mask = 0666 directory mask = 0777 inherit permissions = Yes inherit acls = Yes browsable = Yes hide unreadable = no follow symlinks = yes wide links = yes On Sun, Sep 22, 2019 at 2:42 AM Andrew Walker <walker.aj325 at gmail.com> wrote:> > Can you please post your smb.conf? > > On Sat, Sep 21, 2019 at 12:45 PM Kacper via samba <samba at lists.samba.org> wrote: >> >> Hello, >> >> After upgrading to Samba 4.11 (from 4.10) I noticed that python >> scripts using tempfile.mkstemp fail when run against samba cifs >> mounts. Before I submit a bug report, could someone else try this out >> so it's not just my setup? >> >> How to reproduce: >> 1. Mount a Samba 4.11 share using the mount command: mount >> //server1/share /tmp/share1 >> 2. Run python script that is using mkstemp: >> import shutil >> import tempfile >> >> tmp_dest_fd, tmp_dest_name = tempfile.mkstemp(prefix=b'.file_tmp', >> dir='/tmp/share1', suffix='test.pdf') >> shutil.move('testfile', tmp_dest_name) >> >> Result: >> Traceback (most recent call last): >> File "./test.py", line 9, in <module> >> shutil.move('testfile', tmp_dest_name) >> File "/usr/lib64/python2.7/shutil.py", line 301, in move >> copy2(src, real_dst) >> File "/usr/lib64/python2.7/shutil.py", line 130, in copy2 >> copyfile(src, dst) >> File "/usr/lib64/python2.7/shutil.py", line 83, in copyfile >> with open(dst, 'wb') as fdst: >> IOError: [Errno 116] Stale file handle: '/tmp/share1/.file_tmplB0NqLtest.pdf' >> >> Expected results: >> The operation should succeed without a stale file handle error. >> >> Environment: >> Centos 7.6 / 3.10.0-1062.el7.x86_64 >> Python 3.6 / 2 >> Samba 4.11 >> >> Regards, >> Kacper >> >> -- >> To unsubscribe from this list go to the following URL and read the >> instructions: https://lists.samba.org/mailman/options/samba
On 22/09/2019 10:17, Kacper via samba wrote:> [global] > workgroup = example > realm = example.test > netbios name = server1 > server role = active directory domain controller > log file = /var/log/samba/smbd.log > > server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, drepl, > winbindd, ntp_signd, kcc, dnsupdate > domain logons = Yes > wins support = Yes > security = user > preferred master = auto > domain master = yes > local master = yes > unix extensions = no > > interfaces = 127.0.0.1 192.168.0.30 > bind interfaces only = yes > > [netlogon] > path = /usr/local/samba/var/locks/sysvol/example.test/scripts > read only = No > browsable = No > > [sysvol] > path = /usr/local/samba/var/locks/sysvol > read only = No > inherit acls = Yes > dos filemode = true > force unknown acl user = true > browsable = No > > [profiles] > path = /usr/local/samba/var/locks/profiles > read only = no > create mask = 0600 > directory mask = 0700 > dos filemode = true > browsable = No > > [share] > path = /share > read only = No > create mask = 0666 > directory mask = 0777 > inherit permissions = Yes > inherit acls = Yes > browsable = Yes > hide unreadable = no > follow symlinks = yes > wide links = yes >Kacper, that is a smb.conf from a 'borked' DC, you cannot have a DC set up like that. Remove these lines from [global] domain logons = Yes wins support = Yes security = user preferred master = auto domain master = yes local master = yes unix extensions = no Remove these lines from [sysvol] inherit acls = Yes dos filemode = true force unknown acl user = true browsable = No Remove these lines from [profiles] create mask = 0600 directory mask = 0700 dos filemode = true browsable = No Remove these lines from [share] create mask = 0666 directory mask = 0777 inherit permissions = Yes inherit acls = Yes browsable = Yes hide unreadable = no follow symlinks = yes wide links = yes Then read these: https://wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs https://wiki.samba.org/index.php/Roaming_Windows_User_Profiles Rowland
Thank you for noticing. I've inherited the config setup and it hasn't been updated for a long while. Still the changes had no bearing on the original problem of "stale file handle", not that I expected them to, it was worth a try though. On Sun, Sep 22, 2019 at 11:33 AM Rowland penny via samba <samba at lists.samba.org> wrote:> > On 22/09/2019 10:17, Kacper via samba wrote: > > [global] > > workgroup = example > > realm = example.test > > netbios name = server1 > > server role = active directory domain controller > > log file = /var/log/samba/smbd.log > > > > server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, drepl, > > winbindd, ntp_signd, kcc, dnsupdate > > domain logons = Yes > > wins support = Yes > > security = user > > preferred master = auto > > domain master = yes > > local master = yes > > unix extensions = no > > > > interfaces = 127.0.0.1 192.168.0.30 > > bind interfaces only = yes > > > > [netlogon] > > path = /usr/local/samba/var/locks/sysvol/example.test/scripts > > read only = No > > browsable = No > > > > [sysvol] > > path = /usr/local/samba/var/locks/sysvol > > read only = No > > inherit acls = Yes > > dos filemode = true > > force unknown acl user = true > > browsable = No > > > > [profiles] > > path = /usr/local/samba/var/locks/profiles > > read only = no > > create mask = 0600 > > directory mask = 0700 > > dos filemode = true > > browsable = No > > > > [share] > > path = /share > > read only = No > > create mask = 0666 > > directory mask = 0777 > > inherit permissions = Yes > > inherit acls = Yes > > browsable = Yes > > hide unreadable = no > > follow symlinks = yes > > wide links = yes > > > Kacper, that is a smb.conf from a 'borked' DC, you cannot have a DC set > up like that. > > Remove these lines from [global] > > domain logons = Yes > wins support = Yes > security = user > preferred master = auto > domain master = yes > local master = yes > unix extensions = no > > Remove these lines from [sysvol] > > inherit acls = Yes > dos filemode = true > force unknown acl user = true > browsable = No > > Remove these lines from [profiles] > > create mask = 0600 > directory mask = 0700 > dos filemode = true > browsable = No > > Remove these lines from [share] > > create mask = 0666 > directory mask = 0777 > inherit permissions = Yes > inherit acls = Yes > browsable = Yes > hide unreadable = no > follow symlinks = yes > wide links = yes > > Then read these: > > https://wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs > > https://wiki.samba.org/index.php/Roaming_Windows_User_Profiles > > Rowland > > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba