]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agos3/auth: implement "winbind:ignore domains"
Ralph Boehme [Fri, 15 Jan 2021 11:56:25 +0000 (12:56 +0100)] 
s3/auth: implement "winbind:ignore domains"

Under the following conditions a user from an ignored domain might be able to
authenticate:

- using Kerberos

- successfully previous authentication so the idmap and name caches are filled

- winbind not running (fwiw, winbindd is mandatory on a domain member)

- nscd running with a cached getpwnam for the ignored user (otherwise auth fails
  because getpwnam fails)

- lookup_name() function being modified to look into the name cache before
  contacting winbindd. Currently it talks directly to winbindd and that will
  check the cache.

Currently, authentication will only fail because creating the local token for
the user fails because an LSA lookupname RPC call fails (because winbindd is not
running).

All of this makes a successfull authentication unlikelly, but that is more by
accident then by design.

To ensures that if winbindd is not running and as such winbindd itself can not
enforce the restriction, also implement the ignored domains check in the auth
system as a last line of defense.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602
RN: "winbind:ignore domains" doesn't prevent user login from trusted domain

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: check for allowed domains in winbindd_pam_auth_pac_verify()
Ralph Boehme [Thu, 14 Jan 2021 09:42:53 +0000 (10:42 +0100)] 
winbind: check for allowed domains in winbindd_pam_auth_pac_verify()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: check for allowed domains in winbindd_dual_pam_chauthtok()
Ralph Boehme [Mon, 11 Jan 2021 16:59:48 +0000 (17:59 +0100)] 
winbind: check for allowed domains in winbindd_dual_pam_chauthtok()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: check for allowed domains in winbindd_dual_pam_chng_pswd_auth_crap()
Ralph Boehme [Mon, 11 Jan 2021 16:19:05 +0000 (17:19 +0100)] 
winbind: check for allowed domains in winbindd_dual_pam_chng_pswd_auth_crap()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: check for allowed domains in winbindd_dual_pam_auth_crap()
Ralph Boehme [Mon, 11 Jan 2021 16:10:19 +0000 (17:10 +0100)] 
winbind: check for allowed domains in winbindd_dual_pam_auth_crap()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: check for allowed domains in winbindd_dual_pam_auth()
Ralph Boehme [Mon, 11 Jan 2021 15:50:31 +0000 (16:50 +0100)] 
winbind: check for allowed domains in winbindd_dual_pam_auth()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: move "winbind:ignore domain" logic to a seperate function
Ralph Boehme [Mon, 11 Jan 2021 15:15:15 +0000 (16:15 +0100)] 
winbind: move "winbind:ignore domain" logic to a seperate function

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoselftest: add a test for "winbind:ignore domains"
Ralph Boehme [Wed, 13 Jan 2021 10:54:40 +0000 (11:54 +0100)] 
selftest: add a test for "winbind:ignore domains"

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: handle MSG_SMB_CONF_UPDATED in the winbinds children
Ralph Boehme [Wed, 20 Jan 2021 11:00:16 +0000 (12:00 +0100)] 
winbind: handle MSG_SMB_CONF_UPDATED in the winbinds children

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: set logfile after reloading config
Ralph Boehme [Wed, 20 Jan 2021 11:27:23 +0000 (12:27 +0100)] 
winbind: set logfile after reloading config

lp_load_global() will overwrite whatever we've set with lp_set_logfile().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowinbind: move config-reloading code to winbindd_dual.c
Ralph Boehme [Wed, 20 Jan 2021 10:17:22 +0000 (11:17 +0100)] 
winbind: move config-reloading code to winbindd_dual.c

In preperation of forwarding MSG_SMB_CONF_UPDATED to all childs.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoselftest: use correct DNS domain name for wrapper hosts file
Ralph Boehme [Thu, 14 Jan 2021 07:14:46 +0000 (08:14 +0100)] 
selftest: use correct DNS domain name for wrapper hosts file

For some reason the join fails to register the DNS records when provisioning the
member env:

   Using short domain name -- SAMBA2008R2
   Joined 'IDMAPADMEMBER' to dns domain 'samba2008r2.example.com'
   DNS Update for idmapadmember.samba.example.com failed: ERROR_DNS_UPDATE_FAILED

At the same time the hosts file used by the wrappers contains the wrong fqdn. As
a result the test that the next commit is going do add fails due do the broken
DNS resolution:

...
UNEXPECTED(failure): samba3.blackbox.winbind_ignore_domain.test_winbind_ignore_domains_ok_krb5(ad_member_idmap_ad:local)
REASON: Exception: Exception: do_connect: Connection to idmapadmember.samba2008r2.example.com failed (Error NT_STATUS_UNSUCCESSFUL)
...

Checking DNS in the testenv, first the working record for the main DC:

testenv$ dig @10.53.57.64 dc7.samba2008r2.example.com +short
10.53.57.27

testenv$ bin/samba-tool dns query dc7 samba2008r2.example.com dc7 A -U Administrator%locDCpass7
  Name=, Records=1, Children=0
    A: 10.53.57.27 (flags=f0, serial=1, ttl=900)

Now the failing idmapadmember:

testenv$ dig @10.53.57.64 idmapadmember.samba2008r2.example.com +short

testenv$ bin/samba-tool dns query dc7 samba2008r2.example.com idmapadmember A -U Administrator%locDCpass7
ERROR: Record or zone does not exist.

Fixing the hosts file lets the tests work, fixing the broken DNS record
registration is a task for another day.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoVFS: unityed_media: Fixup um_mknodat() to correctly use the dirfsp path.
Jeremy Allison [Wed, 20 Jan 2021 20:30:10 +0000 (12:30 -0800)] 
VFS: unityed_media: Fixup um_mknodat() to correctly use the dirfsp path.

Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agoVFS: unityed_media: Fix um_mkdirat() to correctly look at the full pathname.
Jeremy Allison [Wed, 20 Jan 2021 20:27:16 +0000 (12:27 -0800)] 
VFS: unityed_media: Fix um_mkdirat() to correctly look at the full pathname.

Missed in the original mkdirat fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agoVFS: time_audit: Fixup smb_time_audit_mknodat() to log the dirfsp path.
Jeremy Allison [Wed, 20 Jan 2021 20:22:29 +0000 (12:22 -0800)] 
VFS: time_audit: Fixup smb_time_audit_mknodat() to log the dirfsp path.

Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agoVFS: syncops: Fixup all uses of the SYNCOPS_NEXT_SMB_FNAME macro to correctly use...
Jeremy Allison [Wed, 20 Jan 2021 20:11:01 +0000 (12:11 -0800)] 
VFS: syncops: Fixup all uses of the SYNCOPS_NEXT_SMB_FNAME macro to correctly use the dirfsp path.

Remove the temp solution added to syncops_mkdirat()
as we now have a generic fix.

Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agoVFS: shadow_copy2: Fixup shadow_copy2_mknodat() to correctly use the dirfsp path.
Jeremy Allison [Wed, 20 Jan 2021 19:59:16 +0000 (11:59 -0800)] 
VFS: shadow_copy2: Fixup shadow_copy2_mknodat() to correctly use the dirfsp path.

Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agoVFS: media_harmony: Fixup mh_mknodat() to correctly use the dirfsp path.
Jeremy Allison [Wed, 20 Jan 2021 19:56:36 +0000 (11:56 -0800)] 
VFS: media_harmony: Fixup mh_mknodat() to correctly use the dirfsp path.

Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agoVFS: full_audit: Fixup smb_full_audit_mknodat() to log the dirfsp path.
Jeremy Allison [Wed, 20 Jan 2021 19:51:16 +0000 (11:51 -0800)] 
VFS: full_audit: Fixup smb_full_audit_mknodat() to log the dirfsp path.

Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agoVFS: cap: Fixup cap_mknodat() to cope with translating dirfsp path.
Jeremy Allison [Wed, 20 Jan 2021 19:33:03 +0000 (11:33 -0800)] 
VFS: cap: Fixup cap_mknodat() to cope with translating dirfsp path.

Missed in my original fixes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
5 years agovfs_fruit: make use of adouble_open_from_base_fsp(ADOUBLE_RSRC) in fruit_open_rsrc_ad...
Stefan Metzmacher [Tue, 8 Dec 2020 15:29:10 +0000 (16:29 +0100)] 
vfs_fruit: make use of adouble_open_from_base_fsp(ADOUBLE_RSRC) in fruit_open_rsrc_adouble()

The key is that we return a fake_fd to the caller and only open
the '._' file in the background.

The next vfs backend should only see the fsp from
adouble_open_from_base_fsp, while the vfs backends above
should only see the fake_fd.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jan 21 14:47:53 UTC 2021 on sn-devel-184

5 years agovfs_fruit: add fruit_get_complete_fio() helper
Stefan Metzmacher [Thu, 10 Dec 2020 12:11:06 +0000 (13:11 +0100)] 
vfs_fruit: add fruit_get_complete_fio() helper

This will make it easier to hide some fsp extension later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agovfs_fruit: let fruit_open_rsrc_adouble() return errno = EISDIR
Stefan Metzmacher [Wed, 30 Dec 2020 12:49:37 +0000 (13:49 +0100)] 
vfs_fruit: let fruit_open_rsrc_adouble() return errno = EISDIR

That hopefully makes the check that ':AFP_Resource' can't
be created on directories.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:adouble: add adouble_open_from_base_fsp()
Stefan Metzmacher [Wed, 23 Dec 2020 10:58:08 +0000 (11:58 +0100)] 
s3:adouble: add adouble_open_from_base_fsp()

For now we only support ADOUBLE_RSRC, but that might change in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:adouble: allow ad_fget/ad_get_internal to be used with a backend fsp
Stefan Metzmacher [Wed, 23 Dec 2020 10:58:08 +0000 (11:58 +0100)] 
s3:adouble: allow ad_fget/ad_get_internal to be used with a backend fsp

Up to now we only passed in stream fsp, but that will change shortly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoshare_mode_lock: DEBUG/ASSERT recursion deadlock detection
Stefan Metzmacher [Wed, 23 Dec 2020 10:59:05 +0000 (11:59 +0100)] 
share_mode_lock: DEBUG/ASSERT recursion deadlock detection

This situation should never happen!

The known trigger is fixed with the change to adouble_open_rsrc_fsp()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:adouble: rewrite ad_open_rsrc() as adouble_open_rsrc_fsp() using create_internal_fsp()
Stefan Metzmacher [Wed, 23 Dec 2020 10:58:08 +0000 (11:58 +0100)] 
s3:adouble: rewrite ad_open_rsrc() as adouble_open_rsrc_fsp() using create_internal_fsp()

"._" AppleDouble files are hidden by vfs_fruit by default, so there's no
need to go through a full SMB_VFS_CREATE_FILE() for them.

They don't need an smbXsrv_open_global.tdb entry nor a locking.tdb
entry, so we just open them with fd_openat().

This avoids a recursion deadlock in get_share_mode_lock() when closing
the ':AFP_Resource' stream.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoWHATSNEW: Start release notes for Samba 4.15.0pre1.
Karolin Seeger [Thu, 21 Jan 2021 12:55:25 +0000 (13:55 +0100)] 
WHATSNEW: Start release notes for Samba 4.15.0pre1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Bump version up to 4.15.0pre1...
Karolin Seeger [Thu, 21 Jan 2021 12:51:20 +0000 (13:51 +0100)] 
VERSION: Bump version up to 4.15.0pre1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoVERSION: Disable GIT_SNAPSHOT for the 4.14.0rc1 release. samba-4.14.0rc1
Karolin Seeger [Thu, 21 Jan 2021 12:48:52 +0000 (13:48 +0100)] 
VERSION: Disable GIT_SNAPSHOT for the 4.14.0rc1 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoWHATSNEW: Add release notes for Samba 4.14.0rc1.
Karolin Seeger [Thu, 21 Jan 2021 12:47:02 +0000 (13:47 +0100)] 
WHATSNEW: Add release notes for Samba 4.14.0rc1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
5 years agoReleaseKey: add GnuPG key transition statement for the Samba release key
Karolin Seeger [Thu, 21 Jan 2021 12:02:26 +0000 (13:02 +0100)] 
ReleaseKey: add GnuPG key transition statement for the Samba release key

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoscript/release.sh: always select the GPG key by it's ID
Karolin Seeger [Thu, 21 Jan 2021 12:03:44 +0000 (13:03 +0100)] 
script/release.sh: always select the GPG key by it's ID

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoWHATSNEW.txt: Miscellaneous samba-tool changes
Björn Baumbach [Mon, 18 Jan 2021 14:02:22 +0000 (15:02 +0100)] 
WHATSNEW.txt: Miscellaneous samba-tool changes

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
5 years agolibcli:smb: Fix a typo in a debug message
Andreas Schneider [Tue, 19 Jan 2021 14:50:24 +0000 (15:50 +0100)] 
libcli:smb: Fix a typo in a debug message

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jan 19 16:15:21 UTC 2021 on sn-devel-184

5 years agovfs: update status of SMB_VFS_SYMLINKAT()
Jeremy Allison [Fri, 15 Jan 2021 22:50:23 +0000 (14:50 -0800)] 
vfs: update status of SMB_VFS_SYMLINKAT()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Jan 17 05:48:14 UTC 2021 on sn-devel-184

5 years agos3: smbd: Change smb_set_file_unix_link() to use a real directory fsp for SMB_VFS_SYM...
Jeremy Allison [Fri, 15 Jan 2021 22:29:08 +0000 (14:29 -0800)] 
s3: smbd: Change smb_set_file_unix_link() to use a real directory fsp for SMB_VFS_SYMLINKAT().

New VFS change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: VFS: glusterfs: Fix vfs_gluster_symlinkat() to cope with a real dirfsp.
Jeremy Allison [Fri, 15 Jan 2021 22:35:58 +0000 (14:35 -0800)] 
s3: VFS: glusterfs: Fix vfs_gluster_symlinkat() to cope with a real dirfsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: VFS: ceph: Fix cephwrap_symlinkat() to cope with real directory fsps.
Jeremy Allison [Fri, 15 Jan 2021 22:33:17 +0000 (14:33 -0800)] 
s3: VFS: ceph: Fix cephwrap_symlinkat() to cope with real directory fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agovfs: directory enumeration is now handle based
Ralph Boehme [Fri, 15 Jan 2021 15:37:56 +0000 (16:37 +0100)] 
vfs: directory enumeration is now handle based

Remove obsolete description. Also remove SMB_VFS_STATX() as I don't see a need
for that atm.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 15 22:01:55 UTC 2021 on sn-devel-184

5 years agovfs: update status of SMB_VFS_MKDIRAT()
Ralph Boehme [Fri, 15 Jan 2021 09:13:36 +0000 (10:13 +0100)] 
vfs: update status of SMB_VFS_MKDIRAT()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopysmbd: use real dirfsp for SMB_VFS_MKDIRAT()
Ralph Boehme [Fri, 15 Jan 2021 09:12:29 +0000 (10:12 +0100)] 
pysmbd: use real dirfsp for SMB_VFS_MKDIRAT()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs: update status of SMB_VFS_MKNODAT()
Ralph Boehme [Fri, 15 Jan 2021 08:54:15 +0000 (09:54 +0100)] 
vfs: update status of SMB_VFS_MKNODAT()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: smbd: Change smb_unix_mknod() to use a real directory fsp for SMB_VFS_MKNODAT().
Jeremy Allison [Thu, 14 Jan 2021 20:18:50 +0000 (12:18 -0800)] 
s3: smbd: Change smb_unix_mknod() to use a real directory fsp for SMB_VFS_MKNODAT().

New VFS change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: smbd: Move creation of parent_fname out of lp_inherit_permissions() clause in...
Jeremy Allison [Thu, 14 Jan 2021 19:50:39 +0000 (11:50 -0800)] 
s3: smbd: Move creation of parent_fname out of lp_inherit_permissions() clause in smb_unix_mknod().

We will need this for the upcoming openat_pathref_fsp() use.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: VFS: glusterfs: Fix vfs_gluster_mknodat() to cope with a real dirfsp.
Jeremy Allison [Thu, 14 Jan 2021 20:25:24 +0000 (12:25 -0800)] 
s3: VFS: glusterfs: Fix vfs_gluster_mknodat() to cope with a real dirfsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: VFS: glusterfs: Fix missing END_PROFILE() in mkdirat() return.
Jeremy Allison [Thu, 14 Jan 2021 20:26:48 +0000 (12:26 -0800)] 
s3: VFS: glusterfs: Fix missing END_PROFILE() in mkdirat() return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: VFS: ceph: Fix cephwrap_mknodat() to cope with real directory fsps.
Jeremy Allison [Thu, 14 Jan 2021 20:35:29 +0000 (12:35 -0800)] 
s3: VFS: ceph: Fix cephwrap_mknodat() to cope with real directory fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: VFS: ceph: Fix cephwrap_mkdirat() to cope with real directory fsps.
Jeremy Allison [Thu, 14 Jan 2021 20:31:24 +0000 (12:31 -0800)] 
s3: VFS: ceph: Fix cephwrap_mkdirat() to cope with real directory fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosamba-tool: Optionally hide disabled/expired accounts in "group listmembers"
Björn Baumbach [Wed, 23 Dec 2020 14:51:12 +0000 (15:51 +0100)] 
samba-tool: Optionally hide disabled/expired accounts in "group listmembers"

  --hide-expired        Do not list expired group members
  --hide-disabled       Do not list disabled group members

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 15 16:34:11 UTC 2021 on sn-devel-184

5 years agosamba-tool: Optionally hide disabled/expired accounts in "user list"
Björn Baumbach [Wed, 23 Dec 2020 12:00:34 +0000 (13:00 +0100)] 
samba-tool: Optionally hide disabled/expired accounts in "user list"

  --hide-expired        Do not list expired user accounts
  --hide-disabled       Do not list disabled user accounts

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agodoc/samba-tool: describe command parameters for "user list" command
Björn Baumbach [Wed, 23 Dec 2020 15:39:55 +0000 (16:39 +0100)] 
doc/samba-tool: describe command parameters for "user list" command

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agodoc/samba-tool: describe command parameters for "group listmembers" command
Björn Baumbach [Wed, 23 Dec 2020 15:48:31 +0000 (16:48 +0100)] 
doc/samba-tool: describe command parameters for "group listmembers" command

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agolibcli/smb: allow unexpected padding in SMB2 IOCTL responses
Stefan Metzmacher [Thu, 14 Jan 2021 16:32:15 +0000 (17:32 +0100)] 
libcli/smb: allow unexpected padding in SMB2 IOCTL responses

A NetApp Ontap 7.3.7 SMB server add 8 padding bytes to an
offset that's already 8 byte aligned.

RN: Work around special SMB2 IOCTL response behavior of NetApp Ontap 7.3.7
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 15 08:36:34 UTC 2021 on sn-devel-184

5 years agosmbd: implement FSCTL_SMBTORTURE_IOCTL_RESPONSE_BODY_PADDING8 as reproducer for bug...
Stefan Metzmacher [Thu, 14 Jan 2021 16:39:01 +0000 (17:39 +0100)] 
smbd: implement FSCTL_SMBTORTURE_IOCTL_RESPONSE_BODY_PADDING8 as reproducer for bug 14607

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos4:torture/smb2: add samba3.smb2.ioctl.bug14607
Stefan Metzmacher [Thu, 14 Jan 2021 16:39:18 +0000 (17:39 +0100)] 
s4:torture/smb2: add samba3.smb2.ioctl.bug14607

FSCTL_SMBTORTURE_IOCTL_RESPONSE_BODY_PADDING8 will be used
to trigger an SMB2 IOCTL response with extra padding.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agolibcli/smb: split out smb2cli_ioctl_parse_buffer()
Stefan Metzmacher [Thu, 14 Jan 2021 16:27:21 +0000 (17:27 +0100)] 
libcli/smb: split out smb2cli_ioctl_parse_buffer()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
5 years agolibcli/smb: Allow smb2cli_validate_negotiate_info_done() to ignore NT_STATUS_INVALID_...
Jeremy Allison [Wed, 6 Jan 2021 17:03:05 +0000 (09:03 -0800)] 
libcli/smb: Allow smb2cli_validate_negotiate_info_done() to ignore NT_STATUS_INVALID_PARAMETER.

This can be returned from NetApp Ontap 7.3.7 SMB server
implementations. Now we have ensured smb2_signing_check_pdu()
cannot return NT_STATUS_INVALID_PARAMETER on a signing error
it's safe to check this error code here. Windows 10
clients ignore this error from the NetApp.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolibcli/smb: Change some checks to SMB_ASSERTS
Stefan Metzmacher [Mon, 11 Jan 2021 09:01:39 +0000 (10:01 +0100)] 
libcli/smb: Change some checks to SMB_ASSERTS

If we end up here, it's definitely a programming error in the basic
parsing layer of the SMB2 packet.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agovfs: The New VFS
Ralph Boehme [Wed, 9 Dec 2020 21:04:31 +0000 (13:04 -0800)] 
vfs: The New VFS

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 14 19:00:05 UTC 2021 on sn-devel-184

5 years agosmbd: inherit st_ex_mode to basename from stream name in create_file_unixpath()
Ralph Boehme [Tue, 12 Jan 2021 11:23:38 +0000 (12:23 +0100)] 
smbd: inherit st_ex_mode to basename from stream name in create_file_unixpath()

This ensures smb_fname_base knows if it's a file or directory.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: call vfs_stat() in mkdir_internal()
Ralph Boehme [Tue, 12 Jan 2021 11:03:33 +0000 (12:03 +0100)] 
smbd: call vfs_stat() in mkdir_internal()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoprinting: call vfs_stat() in driver_unlink_internals()
Ralph Boehme [Tue, 12 Jan 2021 11:03:02 +0000 (12:03 +0100)] 
printing: call vfs_stat() in driver_unlink_internals()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibadouble: assert valid stat in ad_unconvert_get_streams()
Ralph Boehme [Tue, 12 Jan 2021 11:02:40 +0000 (12:02 +0100)] 
libadouble: assert valid stat in ad_unconvert_get_streams()

All callers already stat the path, just add a check that asserts this.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibadouble: call vfs_stat() in ad_convert_finderinfo()
Ralph Boehme [Tue, 12 Jan 2021 10:59:33 +0000 (11:59 +0100)] 
libadouble: call vfs_stat() in ad_convert_finderinfo()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibadouble: call vfs_stat() in ad_convert_xattr()
Ralph Boehme [Tue, 12 Jan 2021 10:59:02 +0000 (11:59 +0100)] 
libadouble: call vfs_stat() in ad_convert_xattr()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopysmbd: call vfs_stat() in set_sys_acl_conn()
Ralph Boehme [Tue, 12 Jan 2021 10:58:41 +0000 (11:58 +0100)] 
pysmbd: call vfs_stat() in set_sys_acl_conn()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/rpc_server: add deps of rpc_mdssvc_module
Ralph Boehme [Thu, 7 Jan 2021 14:51:26 +0000 (15:51 +0100)] 
s3/rpc_server: add deps of rpc_mdssvc_module

This allows removing allow_undefined_symbols=True.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jan 14 16:05:10 UTC 2021 on sn-devel-184

5 years agorpc_server: Remove protocol-specific dcerpc_setup_ routines
Volker Lendecke [Tue, 12 Jan 2021 16:53:57 +0000 (17:53 +0100)] 
rpc_server: Remove protocol-specific dcerpc_setup_ routines

These are all just stream sockets, being taken care of by
dcesrv_setup_ncacn_listener()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan 14 14:35:58 UTC 2021 on sn-devel-184

5 years agorpc_server: Use dcesrv_setup_ncacn_listener() in dcesrv_setup_endpoint_sockets()
Volker Lendecke [Tue, 12 Jan 2021 16:36:44 +0000 (17:36 +0100)] 
rpc_server: Use dcesrv_setup_ncacn_listener() in dcesrv_setup_endpoint_sockets()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Add dcesrv_setup_ncacn_listener()
Volker Lendecke [Tue, 12 Jan 2021 15:48:25 +0000 (16:48 +0100)] 
rpc_server: Add dcesrv_setup_ncacn_listener()

This is supposed to replace the protocol-specific dcerpc_setup_*
functions. They are all very similar except the way to create the
socket file descriptor. By handing out the anonymous structure
"listen_state" for an error path the listener tevent_fd structs can be
cancelled individually or handed over to other talloc parents.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Move setting ip-based socket options
Volker Lendecke [Tue, 12 Jan 2021 16:03:42 +0000 (17:03 +0100)] 
rpc_server: Move setting ip-based socket options

All ncacn_ip_tcp listener sockets are created via
dcesrv_create_ncacn_ip_tcp_socket(). Moving setting the socket options
out of dcesrv_setup_ncacn_ip_tcp_socket() to remove a special case for
TCP from the dcesrv_setup_* family of routines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Direct pointer initialization in dcesrv_ncacn_np_accept_done()
Volker Lendecke [Tue, 12 Jan 2021 15:57:59 +0000 (16:57 +0100)] 
rpc_server: Direct pointer initialization in dcesrv_ncacn_np_accept_done()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agolib: Initialize variables in prefork_listen_accept_handler()
Volker Lendecke [Mon, 11 Jan 2021 14:36:11 +0000 (15:36 +0100)] 
lib: Initialize variables in prefork_listen_accept_handler()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agolib: Fix typos
Volker Lendecke [Mon, 11 Jan 2021 14:23:41 +0000 (15:23 +0100)] 
lib: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Make dcerpc_ncacn_accept() take tsocket_address **
Volker Lendecke [Tue, 12 Jan 2021 08:26:24 +0000 (09:26 +0100)] 
rpc_server: Make dcerpc_ncacn_accept() take tsocket_address **

dcerpc_ncacn_accept() talloc_move's the addresses away from the
caller's talloc hierarchy. Don't leave pointers around in the caller.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agotsocket: Fix a few typos
Volker Lendecke [Tue, 12 Jan 2021 08:25:45 +0000 (09:25 +0100)] 
tsocket: Fix a few typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Remove unused make_server_pipes_struct()
Volker Lendecke [Mon, 11 Jan 2021 20:37:08 +0000 (21:37 +0100)] 
rpc_server: Remove unused make_server_pipes_struct()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Use make_base_pipes_struct() in make_internal_rpc_pipe_socketpair()
Volker Lendecke [Mon, 11 Jan 2021 20:35:26 +0000 (21:35 +0100)] 
rpc_server: Use make_base_pipes_struct() in make_internal_rpc_pipe_socketpair()

make_server_pipes_struct() is just a simple wrapper.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Use make_base_pipes_struct() in dcesrv_ncacn_accept_step2()
Volker Lendecke [Mon, 11 Jan 2021 20:32:52 +0000 (21:32 +0100)] 
rpc_server: Use make_base_pipes_struct() in dcesrv_ncacn_accept_step2()

make_server_pipes_struct() is just a simple wrapper.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agorpc_server: Simplify find_policy_by_hnd_internal()
Volker Lendecke [Mon, 11 Jan 2021 20:25:40 +0000 (21:25 +0100)] 
rpc_server: Simplify find_policy_by_hnd_internal()

Best viewed with "git show -b". Use the typical pattern of an early
error return.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agovfs_fruit: Fix CID 1471764 Dereference null return value
Volker Lendecke [Tue, 12 Jan 2021 10:24:38 +0000 (11:24 +0100)] 
vfs_fruit: Fix CID 1471764 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agovfs_fruit: Fix CID 1471760 Dereference null return value
Volker Lendecke [Tue, 12 Jan 2021 10:22:57 +0000 (11:22 +0100)] 
vfs_fruit: Fix CID 1471760 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agotdb: Fix CID 1471761 String not null terminated
Volker Lendecke [Tue, 12 Jan 2021 10:19:54 +0000 (11:19 +0100)] 
tdb: Fix CID 1471761 String not null terminated

This is a false positive (in is length 3 initialized to 0), but this
patch does not hurt

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
5 years agos3:smbd: simplify the error handling in create_file_unixpath()
Stefan Metzmacher [Mon, 21 Dec 2020 15:49:03 +0000 (16:49 +0100)] 
s3:smbd: simplify the error handling in create_file_unixpath()

We can just call close_file(req, fsp, ERROR_CLOSE), as it handles
non-fsa fsp's and base_fsp's just fine.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 14 12:40:56 UTC 2021 on sn-devel-184

5 years agos3:smbd: allow close_file() with a non-fsa fsp for {SHUTDOWN,ERROR}_CLOSE
Stefan Metzmacher [Wed, 23 Dec 2020 11:10:37 +0000 (12:10 +0100)] 
s3:smbd: allow close_file() with a non-fsa fsp for {SHUTDOWN,ERROR}_CLOSE

Such an fsp was typically created via create_internal_fsp() and
opened via fd_openat() without going through SMB_VFS_CREATE_FILE(),
so they should be closed via fd_close().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: make sure a SHUTDOWN_CLOSE applies to a stream fsp before its base fsp
Stefan Metzmacher [Wed, 23 Dec 2020 10:50:34 +0000 (11:50 +0100)] 
s3:smbd: make sure a SHUTDOWN_CLOSE applies to a stream fsp before its base fsp

Before we had open_pathref_fsp() we had the stream fsp before the base
fsp in the linked list we traverse for SHUTDOWN_CLOSE.

Now the order has changed. I could have used some DLIST_PROMOTE()
hacks, but that's still fragile.

Now we reference both fsp's via ->base_fsp and ->stream_fsp.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: make use of fsp_set_base_fsp() when changing fsp->base_fsp
Stefan Metzmacher [Mon, 21 Dec 2020 15:35:11 +0000 (16:35 +0100)] 
s3:smbd: make use of fsp_set_base_fsp() when changing fsp->base_fsp

This allows us to add some more logic for bi-directional linking between
base and stream fsp in the next commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: add fsp_set_base_fsp() helper
Stefan Metzmacher [Mon, 21 Dec 2020 14:44:22 +0000 (15:44 +0100)] 
s3:smbd: add fsp_set_base_fsp() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: remove duplicate assignment of base_fsp in create_file_unixpath()
Stefan Metzmacher [Mon, 4 Jan 2021 15:33:09 +0000 (16:33 +0100)] 
s3:smbd: remove duplicate assignment of base_fsp in create_file_unixpath()

This has already been set a few lines above. The duplicate was the result of
restructuring create_file_unixpath() a few months ago, allocating fsp in
create_file_unixpath() instead of in the callees open_file_ntcreate() or
open_directory() respectively.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: fix the error cleanup in create_file_unixpath()
Stefan Metzmacher [Mon, 21 Dec 2020 15:40:01 +0000 (16:40 +0100)] 
s3:smbd: fix the error cleanup in create_file_unixpath()

We always need to cleanup the base_fsp!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbd: split out create_internal_fsp() from create_internal_dirfsp()
Stefan Metzmacher [Wed, 23 Dec 2020 10:50:34 +0000 (11:50 +0100)] 
s3:smbd: split out create_internal_fsp() from create_internal_dirfsp()

That will be useful in other places as well.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: make fsp_free() static, it should only ever be called by file_free()
Stefan Metzmacher [Mon, 21 Dec 2020 11:41:06 +0000 (12:41 +0100)] 
s3:smbd: make fsp_free() static, it should only ever be called by file_free()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: let vfs_default_durable_reconnect() use file_free()
Stefan Metzmacher [Mon, 21 Dec 2020 11:18:44 +0000 (12:18 +0100)] 
s3:smbd: let vfs_default_durable_reconnect() use file_free()

We should always go through file_free(), which calls fsp_free() at the end.

Most things in file_free() may not apply to all
vfs_default_durable_reconnect() cases, but we want fsp_free() to become
static to files.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: close pathref fsp in call_trans2findfirst()
Ralph Boehme [Tue, 12 Jan 2021 11:50:43 +0000 (12:50 +0100)] 
s3:smbd: close pathref fsp in call_trans2findfirst()

Before freeing the fsp we have to close the handle.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbd: turn assignment into assert check in call_trans2findfirst()
Ralph Boehme [Mon, 4 Jan 2021 15:09:43 +0000 (16:09 +0100)] 
s3:smbd: turn assignment into assert check in call_trans2findfirst()

The pathref fsp link destructor will set smb_dname->fsp to NULL. Turning this
into an assert to give a hint at readers of the code trying to understand the
mechanics.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:smbd: let call_trans2findfirst() use file_free() instead of fsp_free()
Stefan Metzmacher [Wed, 23 Dec 2020 12:28:40 +0000 (13:28 +0100)] 
s3:smbd: let call_trans2findfirst() use file_free() instead of fsp_free()

This makes sure we call vfs_remove_all_fsp_extensions() before
fsp_free() is called from within file_free(). And allows us to
make 'fsp_free()' static in the next commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: make sure openat_pathref_fsp() calls fd_close(fsp->base_fsp);
Stefan Metzmacher [Mon, 21 Dec 2020 14:31:25 +0000 (15:31 +0100)] 
s3:smbd: make sure openat_pathref_fsp() calls fd_close(fsp->base_fsp);

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: introduce a reopen_from_fsp() helper function
Stefan Metzmacher [Wed, 23 Dec 2020 14:48:36 +0000 (15:48 +0100)] 
s3:smbd: introduce a reopen_from_fsp() helper function

In future we may move the reopen logic to the VFS,
but for now we just keep it in one place.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3:smbd: don't pass an unused smb_fname to reopen_from_procfd()
Stefan Metzmacher [Wed, 23 Dec 2020 15:03:37 +0000 (16:03 +0100)] 
s3:smbd: don't pass an unused smb_fname to reopen_from_procfd()

Both callers pass in a helper variable that points to
fsp->fsp_name and it was only used for a debug message,
so we can simply use fsp_str_dgb() instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>