1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

124875 Commits

Author SHA1 Message Date
Stefan Metzmacher
c6a570004d samba-tool user: add ';format=[GeneralizedTime,UnixTime,TimeSpec]' support in "samba-tool user show"
This is useful to convert various time values to other formats.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Stefan Metzmacher
4d0491324a samba-tool user: add ';format=[GeneralizedTime,UnixTime,TimeSpec]' support
These are useful to convert various time values to other formats.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Stefan Metzmacher
98ee82d4fc samba-tool user: use an implicit_attrs list instead of add_ATTR variables
We'll extent GetPasswordCommand.get_password_attributes() to handle
more virtual formats in future. It'll be much easier to
to maintain a list of attributes we need to filter out again.

sAMAccountName and userPrincipalName are always implicitly
requested in order to keep the existing code sane.

supplementalCredentials and unicodePwd are requested by default
when generating virtual password attributes.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Stefan Metzmacher
06851084ca pyglue: add float2nttime() and nttime2float()
The float value is what the native python time.time()
returns, it's basically a struct timespec converted to
double/float.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Stefan Metzmacher
71e8b24b8a pyldb: catch potential overflow error in py_timestring
Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Björn Baumbach
fdc44a14e4 samba-tool user: use remote domain information
Required, when running get_account_attributes() against a remote samdb.

avoid:
ERROR(<class 'AttributeError'>): uncaught exception - 'NoneType' object has no attribute 'get'
  File "bin/python/samba/netcmd/__init__.py", line 186, in _run
    return self.run(*args, **kwargs)
  File "bin/python/samba/netcmd/user.py", line 2769, in run
    obj = self.get_account_attributes(samdb, username,
  File "bin/python/samba/netcmd/user.py", line 1250, in get_account_attributes
    realm = self.lp.get("realm")

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Björn Baumbach
26f63e648a samba-tool user: fix some typos
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Björn Baumbach
3174c6dd41 s4:dsdb/dirsync: fix a typo in a comment
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Björn Baumbach
485743dac3 s3:libsmb: fix a typo in a comment
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Björn Baumbach
bb00979c08 selftest: fix typos in README files
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-01 03:50:35 +00:00
Noel Power
d6ddb8aa2a vfs: update status of SMB_VFS_LISTXATTR
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb 26 22:35:04 UTC 2021 on sn-devel-184
2021-02-26 22:35:04 +00:00
Noel Power
46226cb219 VFS: Remove SMB_VFS_LISTXATTR, no longer used
---------------
                              /               \
                             /      REST       \
                            /        IN         \
                           /        PEACE        \
                          /                       \
                          |                       |
                          |   SMB_VFS_LISTXATTR   |
                          |                       |
                          |                       |
                          |       10 February     |
                          |          2021         |
                          |                       |
                          |                       |
                         *|     *  *  *           | *
                _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
1d1b80e5dc s3/smbd: Remove connection_struct from get_ea_names_from_file
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
de83946311 s3/smbd: Adjust estimate_ea_size to take files_struct alone
Remove connection_struct parameter (and use fsp->conn)
instead.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
f958b6b86a s3/smbd: let canonicalize_ea_name accept fsp and fstring only in sig
Remove the connection_struct & smb_fname parameters from
canonicalize_ea_name, they arent needed (and can be got from
files_struct)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
df447afa5b s3/smbd: replace get_ea_list_from_file_path with get_ea_list_from_fsp
Additionally remove the old get_ea_list_from_file_path.

get_ea_list_from_file_path & new get_ea_list_from_fsp are identical
except for test for an addition test

+       if (is_ntfs_stream_smb_fname(fsp->fsp_name)) {
+               return NT_STATUS_INVALID_PARAMETER;
+       }

This test should should be fine here too.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
b9ea876fa4 s3/smbd: rename get_ea_list_from_fsp_new to get_ea_list_from_fsp
And remove the old get_ea_list_from_fsp

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
341abce363 s3/smbd: Create new file get_ea_list_from_fsp_new (not used)
On the way to removing get_ea_list_from_file_path and replacing
it with get_ea_list_from_fsp create a copy of get_ea_list_from_file_path
called get_ea_list_from_fsp_new. It is ifdef'ed out for the moment
as it isn't used yet

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
aaea5cc415 s3/smbd: remove connection_struct from get_ea_list_from_file_path
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
ac5de42e9e s3/smsbd: prepare to remove connection_struct param from get_ea_list_from_file_path
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
435119c495 s3/torture: migrate SMB_VFS_FLISTXATTR calls to SMB_VFS_FLISTXATTR
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
9c0660fb53 s3/smbd: remove connection_struct param from get_ea_list_from_file
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
0088d39b8f s3/smbd: rename get_ea_list_from_path -> get_ea_list_from_fsp
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
772b0a0064 s3/smbd: no longer pass smb_fname to get_ea_list_from_file
Finally remove the smb_fname paramater as it is no longer used

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
9e0b123eb8 s3/smbd: prepare get_ea_list_from_file to receive fsp alone
A step to transition away from using smb_fname & fsp
parameter combination with this function by using
the fsp provided by smb_filename->fsp

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
94c441c42e s3/smbd: modify get_ea_list_from_file_path fn signature to take fsp only
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
eca6e43561 s3/smbd: modify estimate_ea_size fn signature to take fsp only
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
5cbab2ebfd s3/smbd: use smb_fname->fsp for get_ea_list_from_file_path in estimate_ea_size()
Additionally ensure get_ea_list_from_file_path is called with base file.

Previously fsp was set to NULL if fsp pointed to a ntfs stream which in
turn ensured that 'base_path' from the smb_fname was used (which points
to the base file). Now we get a pathref fsp (pointing to the base file)
instead

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
dfc80b4ce8 s3/smbd: modify get_ea_names_from_file signature fn to take fsp alone
Removes the smb_filename function parameter

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
6d353212a5 s3/smbd: use SMB_VFS_FLISTXATTR() alone (also added assert fsp is not NULL)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
ecd9b751f1 s3/modules: Ensure vfs_streaminfo gets passed valid pathref smb_filename
the smb_filename/smb_filename->fsp passed to vfs_streaminfo
eventually is passed to SMB_VFS_FLISTXATTR, we need to ensure this is
properly setup and not NULL

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Noel Power
22e0b538c3 s3/smbd: call get_ea_list_from_file with smb_fname->fsp
A step to transition away from using smb_fname & fsp
paramater combination with this function.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-26 21:28:33 +00:00
Peter Eriksson
3d91fe071a s3: VFS: nfs4_acls. Add missing TALLOC_FREE(frame) in error path.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14648

Signed-off-by: Peter Eriksson <pen@lysator.liu.se>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>

Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Thu Feb 25 20:46:02 UTC 2021 on sn-devel-184
2021-02-25 20:46:02 +00:00
David Mulder
85d2406826 samba-tool: Add a gpo command for removing VGP Startup Scripts Group Policy
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 24 22:01:08 UTC 2021 on sn-devel-184
2021-02-24 22:01:08 +00:00
David Mulder
91655e6d71 samba-tool: Test gpo manage script startup remove command
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-24 20:51:30 +00:00
David Mulder
e5efe17246 samba-tool: Add a gpo command for adding VGP Startup Scripts Group Policy
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-24 20:51:30 +00:00
David Mulder
f6a0bd8b91 samba-tool: Test gpo manage script startup add command
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-24 20:51:30 +00:00
David Mulder
d22196117c samba-tool: Add a gpo command for listing VGP Startup Scripts Group Policy
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-24 20:51:30 +00:00
David Mulder
329b6c397b samba-tool: Test gpo manage script startup list command
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-24 20:51:30 +00:00
David Mulder
15cec2ac4d gpo: Apply Group Policy Startup Scripts from VGP
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-24 20:51:30 +00:00
David Mulder
b13b2d8c3e gpo: Test Group Policy VGP Startup Script Policy
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-02-24 20:51:30 +00:00
Douglas Bagnall
e49a0b444a ldb: remove some 'if PY3's in tests
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>

Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Mon Feb 22 15:50:55 UTC 2021 on sn-devel-184
2021-02-22 15:50:55 +00:00
Douglas Bagnall
bc7224fbc7 pytest/segfault: fix the rpc.echo test
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
2021-02-22 14:45:38 +00:00
Douglas Bagnall
f154fe8d95 pytest/segfaults: drop a useless line
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
2021-02-22 14:45:38 +00:00
Douglas Bagnall
9e19b148f6 selftest: preforkrestartdc doesn't need gdb-backtraces
There are tests in this environment that kill processes with SEGV
signals, which causes a backtrace that is entirely spurious from a
debugging point of view.

We can turn that off, saving processor time and moments of developer
confusion.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
2021-02-22 14:45:38 +00:00
Douglas Bagnall
80faba100d pytest:segfault: avoid gdb_backtrace on knownfail
We know that test_net_replicate_init__3() segfaults. It is a knownfail
and we don't need to see the gdb backtrace every time.

This saves nearly two minutes on `make test TESTS=segfault`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
2021-02-22 14:45:38 +00:00
Douglas Bagnall
5b7c2c3b1a selftest/gdb_backtrace: add an off switch
Sometime you know a test is going to crash and produce a LOT of
backtrace, and you already know what it will look like. For those
times you can set

PLEASE_NO_GDB_BACKTRACE=1

and there will be no backtrace, which can save quite a bit of time and
thousands of lines of log file. (In particular, backtraces of Python
programs can take over a minute to complete).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
2021-02-22 14:45:38 +00:00
Ralph Boehme
718f7b1a84 printing: use correct error out in get_correct_cversion() when openat_pathref_fsp() fails
Fixes a regression introduced by a74f0af1a9: if
there's no existing file, openat_pathref_fsp() will fail with
NT_STATUS_OBJECT_NAME_NOT_FOUND which must be handled the same way it is done by
the SMB_VFS_CREATE_FILE() call below.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Feb 17 19:53:00 UTC 2021 on sn-devel-184
2021-02-17 19:53:00 +00:00
Ralph Boehme
70063c523b printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails
Fixes a regression introduced by ef5e913bca: if
there's no existing file, openat_pathref_fsp() will fail with
NT_STATUS_OBJECT_NAME_NOT_FOUND which must be handled the same way it is done by
the SMB_VFS_CREATE_FILE() call below.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2021-02-17 18:48:36 +00:00
Ralph Boehme
8c1fd86db8 printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails
Fixes a regression introduced by cbe25e1777: if
there's no existing file, openat_pathref_fsp() will fail with
NT_STATUS_OBJECT_NAME_NOT_FOUND which must be handled the same way it is done by
the SMB_VFS_CREATE_FILE() call below.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2021-02-17 18:48:36 +00:00