1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

125918 Commits

Author SHA1 Message Date
Andreas Schneider
c216e056b2 selftest: Rename offline logon env to ad_member_offlogon
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May 19 20:01:00 UTC 2021 on sn-devel-184
2021-05-19 20:01:00 +00:00
Jeremy Allison
b7f62e1393 s3: smbd: Ensure POSIX default ACL is mapped into returned Windows ACL for directory handles.
Remove knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed May 19 09:22:56 UTC 2021 on sn-devel-184
2021-05-19 09:22:56 +00:00
Jeremy Allison
544289b54b s3: torture: Add test for bug 14708 - POSIX default ACL not mapped into returned Windows ACL for directory handles.
Knownfail for now.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-19 08:34:30 +00:00
Joseph Sutton
7791acb074 python: Make credentials cache test run against Windows
Windows, unlike Samba, requires the service principal name to be set
when requesting a ticket to that service.

Additionally, default_realm from the libdefaults section of krb5.conf
should be set so that the correct realm is used.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May 19 02:22:01 UTC 2021 on sn-devel-184
2021-05-19 02:22:00 +00:00
Joseph Sutton
b9006f3334 python: Fix ticket timestamp conversion when local timezone is not UTC
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
66695f0f94 python: Fix erroneous increments of reference counts
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
290c1dc097 python: Ensure reference counts are properly incremented
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
78a0b57b51 python: Add SMB credentials cache test
Test that we can use a credentials cache with a user's service ticket
obtained with our Python code to connect to a service through SMB.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
482559436f pylibsmb: Add posix_whoami()
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
9b96ebea5c libsmb: Ensure that whoami parses all the data provided to it
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
9e414233c8 libsmb: Check to see that whoami is not receiving more data than it requested
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
9d8aeed33d libsmb: Avoid undefined behaviour when parsing whoami state
If num_gids is such that the gids array would overflow the rdata buffer,
'p + 8' could produce a result pointing outside the buffer, and thus
result in undefined behaviour. To avoid this, we check num_gids against
the size of the buffer beforehand.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
db5b34c768 libsmb: Remove overflow check
Pointer overflow is undefined, so this check does not accomplish
anything.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
2b487890d9 Revert "libsmb: Use sid_parse()"
This reverts commit afd5d34f5e.

This code originally used ndr_pull_struct_blob() to pull one SID from a
buffer potentially containing multiple SIDs. When this was changed to
use sid_parse(), it was now attempting to parse the whole buffer as a
single SID with ndr_pull_struct_blob_all(), which would cause it to fail
if more than one SID was present.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
072451a033 python: Add RPC credentials cache test
Test that we can use a credentials cache with a user's service ticket
obtained with our Python code to connect to a service through RPC.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
7663b5c37f python: Add LDAP credentials cache test
Test that we can use a credentials cache with a user's service ticket
obtained with our Python code to connect to a service through LDAP.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
c15f26ec40 python: Add credentials cache test
Test that we can use a credentials cache with a user's service ticket
obtained with our Python code to connect to a service using the normal
credentials system backed on to MIT/Heimdal Kerberos 5 libraries. This
will allow us to validate the output of the MIT/Heimdal libraries in the
future.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
2d88a6ff3d krb5: Add Python functions to create a credentials cache containing a service ticket
This is a FILE: format credentials cache readable by the MIT/Heimdal
Kerberos libraries. This allows us to glue the Python ASN1 Kerberos
system to the MIT/Heimdal one.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
1f17b1edca librpc: Test parsing a Kerberos 5 credentials cache with ndrdump
This is the format used by the FILE: credentials cache type.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
74fb2cc473 krb5ccache.idl: Add definition for a Kerberos credentials cache
Based on specifications found at
https://web.mit.edu/kerberos/krb5-devel/doc/formats/ccache_file_format.html

This is primarily designed for parsing and storing a single Kerberos
ticket, due to the limitations of PIDL.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
6f144d49b5 Revert "s4-test: fixed ndrdump test for top level build"
This essentially reverts commit
b84c0a9ed6, but the datapath is now in the
source4 directory.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
50ade4cadc pygensec: Fix method documentation
This changes the docstrings to use the correct method names.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
2d05268aa0 auth:creds: Fix parameter in creds.set_named_ccache()
Use the passed-in value for 'obtained' rather than always using
CRED_SPECIFIED.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Joseph Sutton
1ea2de5618 auth:creds: Remove unused variable
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2021-05-19 01:32:34 +00:00
Jeremy Allison
2867950721 s3: lib: Fix the solaris build. Commit 8d0ea8bafa added SMB_ACL_TYPE_T type to solarisacl_sys_acl_set_fd() in the .c file, but not the .h.
The fact no one noticed means currently no one is
building master on Solaris/Illumos/OmniOS.

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): Tue May 18 19:23:25 UTC 2021 on sn-devel-184
2021-05-18 19:23:25 +00:00
Jeremy Allison
b4c597b6a1 s3: VFS: Update status of SMB_VFS_SYS_ACL_DELETE_DEF_FILE() and SMB_VFS_SYS_ACL_DELETE_DEF_FD().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 18 18:19:28 UTC 2021 on sn-devel-184
2021-05-18 18:19:28 +00:00
Jeremy Allison
0680a38301 s3: smbd: Remove all references to utility and backend functions supporting sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
569474f153 vfs: RIP SMB_VFS_SYS_ACL_DELETE_DEF_FILE()
.--. .-,       .-..-.__
            .'(`.-` \_.-'-./`  |\_( "\__
         __.>\ ';  _;---,._|   / __/`'--)
        /.--.  : |/' _.--.<|  /  | |
    _..-'    `\     /' /`  /_/ _/_/
     >_.-``-. `Y  /' _;---.`|/))))
    '` .-''. \|:  .'   __, .-'"`
     .'--._ `-:  \/:  /'  '.\             _|_
         /.'`\ :;   /'      `-           `-|-`
        -`    |     |                      |
              :.; : |                  .-'~^~`-.
              |:    |                .' _     _ `.
              |:.   |                | |_) | |_) |
              :. :  |                | | \ | |   |
              : ;   |                |           |
              : ;   |                |  SMB_VFS  |
              : ;   |                |  SYS_ACL  |
              : ;   |                |DELETE_DEF |
            .jgs. : ;                |  FILE     |
    -."-/\\\/:::.    `\."-._'."-"_\\-|           |///."-
    " -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-".

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
bf34438ef5 s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
97821542d3 s3: VFS: posixacl: Remove sys_acl_delete_def_file_fn pointer.
Leave the called function as that's in the public API.
We will be able to get rid of it when we delete sys_acl_delete_def_file()
after all the callers are gone.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
39901d1754 s3: VFS: zfsacl: Remove zfsacl_fail__sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
cfa4448341 s3: VFS: unityed_media: Remove um_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
25507668d1 s3: VFS: solarisacl: Remove solarisacl_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
3607212b38 s3: VFS: nfsacl_xattr: Remove nfs4acl_xattr_fail__sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
46bc455582 s3: VFS: media_harmony: Remove mh_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
9cde624d2a s3: VFS: hpuxacl: Remove hpuxacl_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
fedbbc9f63 s3: VFS: gpfs: Remove gpfsacl_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
d646c54c89 s3: VFS: glusterfs: Remove sys_acl_delete_def_file_fn pointer.
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
331d772cc7 s3: VFS: fake_acls: Remove fake_acls_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.com>
2021-05-18 17:29:34 +00:00
Jeremy Allison
ce5fb5b4a0 s3: VFS: ceph: Remove sys_acl_delete_def_file_fn() pointer.
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
51c732a6c4 s3: VFS: catia: Remove catia_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
109dfac02b s3: VFS: cap: Remove cap_sys_acl_delete_def_file().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
2021-05-18 17:29:34 +00:00
Jeremy Allison
981fbf55a6 s3: VFS: aixacl2: Remove aixjfs2_sys_acl_delete_def_file().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
9e1d79dbb2 s3: VFS: aixacl: Remove aixacl_sys_acl_delete_def_file().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
b6700044de s3: torture: cmd_sys_acl_delete_def_file: Move SMB_VFS_SYS_ACL_DELETE_DEF_FILE() -> SMB_VFS_SYS_ACL_DELETE_DEF_FD().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
fd16f9da7c s3: smbd: Change SMB_VFS_SYS_ACL_DELETE_DEF_FILE() -> SMB_VFS_SYS_ACL_DELETE_DEF_FD().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
165de1ca1d s3: VFS: default. In vfswrap_sys_acl_delete_def_file() remove the placeholder code and call sys_acl_delete_def_fd().
This will redirect to the correct backend.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
f75e93ef77 s3: lib: sysacls: Add sys_acl_delete_def_fd().
In the default (posix) case goes to posixacl_sys_acl_delete_def_fd().
For all other systems goes to their relevent backends.

Now we can fill in the delete_def_fd() function in vfs_default.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
33b76a6f24 s3: VFS: zfsacl: Add zfsacl_fail__sys_acl_delete_def_fd().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00
Jeremy Allison
88a2e9f980 s3: VFS: solarisacl: Add solarisacl_sys_acl_delete_def_fd().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2021-05-18 17:29:34 +00:00