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

119919 Commits

Author SHA1 Message Date
Andrew Bartlett
1b6ae21fff build: Prepare for pidl to generate ndr_table entries for more IDL
These IDL files will soon create ndr_table entries so need to be
linked into the ndr-table subsystem.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-progammed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:37 +00:00
Andrew Bartlett
dd8dfa16de s3-build: Skip building the ndr_table at the tail of ndr_libnetapi.c
This is not a real protocol and all the functions are set to nopull,nopush
but do not supply replacement functions.

This is the best was I could find to skip compiling the table as otherwise
it would point to undefined functions.

This does not happen until we generate the ndr_table for idl files without
a UUID, but we will shortly do that.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-progammed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:37 +00:00
Andrew Bartlett
dddef1b822 pidl: Allow the compilation of the ndr_table to be skiped
libnetapi.idl defines a large number of functions a nopull,nopush and
no replacement is provided.

This will allow the ndr_table to be generated for all other IDL files
that may have public structures that could usefully be dumped by
ndrdump.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-progammed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:36 +00:00
Andrew Bartlett
5e0442efbe build: Allow warning on compile of libnetapi PIDL
This not-protocol only uses the print functions, but this means some other functions
are now unused, and as this is a special case it is better to just allow warnings
here.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:36 +00:00
Andrew Bartlett
e45e342624 librpc: Do not include the ndr_table for libnet_join.idl and libnetapi.idl in the global list
These are not wire protocols, there are no structures to parse.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-progammed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:36 +00:00
Andrew Bartlett
88c8cd7a1e librpc: Do not place the ndr_table for windows_event_ids.idl in the global list
This is just a list of event IDs, there are no structures to parse.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-progammed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:36 +00:00
Andrew Bartlett
88373c472c selftest: Add expected-output tests for the ndrdump struct mode
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14191

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:36 +00:00
Douglas Bagnall
dfbb304958 ndrdump: add --stop-on-parse-failure
If a data stream fails to parse as an NDR object, the default ndrdump
action is to try to print those structures anyway, resulting perhaps in
a NULL dereference. Sometimes you don't want to see that because it isn't
very interesting and makes it harder to distinguish a crash in the parse
routines. So --stop-on-parse-failure will skip the print and validate
stages altogether if the parse failed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
2019-11-13 00:32:36 +00:00
Andrew Bartlett
a106ceb7bf librpc: Match interface name and file name for bkupblobs.idl
This helps generate fuzzers for this IDL.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:36 +00:00
Andrew Bartlett
666dbc61f1 librpc: Match interface name and file name for winsrepl.idl
This helps generate fuzzers for this IDL.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-11-13 00:32:36 +00:00
Douglas Bagnall
8a627b5d65 librpc: Fix typo in "quota" name in IDL
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-11-13 00:32:36 +00:00
Volker Lendecke
3fea05e01f smbd: Remove write cache
Since this was written, our write path has changed significantly. In
particular we have gained very flexible support for async I/O, with the
linux io_uring in the pipeline. Caching stuff in main memory and then
doing a blocking pwrite nowadays does not belong into the core smbd
code. If someone wants it back, it should be doable in a VFS module.

Removes: "write cache size" parameter.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 13 00:20:55 UTC 2019 on sn-devel-184
2019-11-13 00:20:55 +00:00
Volker Lendecke
a0aaf5c334 lib: Remove unused file_id_string()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 12 22:18:40 UTC 2019 on sn-devel-184
2019-11-12 22:18:39 +00:00
Volker Lendecke
fea35840b0 smbd: Use file_id_str_buf() in share_mode_cleanup_disconnected()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:35 +00:00
Volker Lendecke
6fe211c85d smbd: Use file_id_str_buf() in share_mode_memcache_fetch()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:35 +00:00
Volker Lendecke
0d246a156d smbd: Use file_id_str_buf() in share_mode_memcache_store()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:35 +00:00
Volker Lendecke
c229c0508b lib: Remove unused file_id_string_tos()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:35 +00:00
Volker Lendecke
64349ce717 torture3: Use file_id_str_buf() in print_brl()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
79291056c5 smbd: Use file_id_str_buf() in linux_release_kernel_oplock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
f7dc033481 smbd: Use file_id_str_buf() in linux_oplock_signal_handler()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
b0a486fabe smbd: Use file_id_str_buf() in scavenger_add_timer()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
0dd11a83dc smbd: Use file_id_str_buf() in file_find_dif()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
420cb1778d smbd: Use file_id_str_buf() in scavenger_timer()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Volker Lendecke
215e7f1fe4 smbd: Use file_id_str_buf() in scavenger_schedule_disconnected()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-12 20:56:34 +00:00
Jeremy Allison
1f5ea9d1d5 s3: smbd: smb2 cleanup - restructure smbd_smb2_request_pending_timer() encrypt code to look the same as smbd_smb2_request_reply().
This makes code changes in both (if needed) much easier
to spot.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-11-12 20:56:34 +00:00
Jeremy Allison
c133a1fd67 s3: smbd: smb2 cleanup - remove variable tf_len - this is a constant SMB2_TF_HDR_SIZE.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-11-12 20:56:34 +00:00
Jeremy Allison
eae1a45d09 s3: smbd: SMB2 - Ensure we use the correct session_id if encrypting an interim response.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14189

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-11-12 20:56:34 +00:00
David Mulder
30e8f513a8 Detect when command line max protocol < min protocol
Due to the increased default minimum protocol
level to SMB2, some users notice that
specifying smbclient -m NT1 fails with
NT_STATUS_CONNECTION_DISCONNECTED, with no SMB
traffic on the wire. Report when the max protocol
is set less than the min protocol.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Nov 12 17:52:28 UTC 2019 on sn-devel-184
2019-11-12 17:52:28 +00:00
Andrew Bartlett
6cf443ab1f s4-libcli: Remove unused header from composite/composite.c
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14170

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Nov 10 22:27:47 UTC 2019 on sn-devel-184
2019-11-10 22:27:47 +00:00
Heiko Baumann
74533b1518 Make sure backup temp directory gets deleted on exception
This fix ensures that the samba-tool backup temp directory is removed
if an exception occurs (e.g. LDAP_INVALID_CREDENTIALS).

Signed-off-by: Heiko Baumann <heibau@gmail.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-11-10 21:03:32 +00:00
Samuel Cabrero
f9eaf4dc71 dns: Always return SOA record for records we should know
Regression introduced by commit 4b54e14b7c,
where the number of returned records is not set by talloc_array_length
when the record is not found.

Found by DELL EMC at SDC SMB3 plugfest trying to perform a secure DNS
update.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Samuel Cabrero <scabrero@samba.org>
Autobuild-Date(master): Fri Nov  8 12:31:30 UTC 2019 on sn-devel-184
2019-11-08 12:31:29 +00:00
Samuel Cabrero
8dbb864349 dns: Extend DNS tests to check the SOA record is always returned
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-08 11:01:29 +00:00
Volker Lendecke
f5f89b1b99 ctdb: Use TALLOC_FREE() in a few places
We have a macro for NULLing out the pointer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Nov  8 01:35:11 UTC 2019 on sn-devel-184
2019-11-08 01:35:11 +00:00
Ralph Boehme
8846887a55 s3:printing: Fix %J substition
print_run_command() uses lp_print_command() which internally performs basic
substition by calling talloc_sub_basic(). As a result. any of the variables in
the "basic set", including "%J" are already substituted.

To prevent the unwanted subtitution, we declare all affected configuration
options as const, which disabled the basic substition.

As a result print_run_command() can run manual substitution on all characters,
including %J, in the variadic argument list *before* calling lp_string() to run
basic substition which we had disabled before with the const.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov  7 16:01:21 UTC 2019 on sn-devel-184
2019-11-07 16:01:21 +00:00
Ralph Boehme
ede00779ab s3:printing: add a DEBUG statement
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-07 14:16:42 +00:00
Ralph Boehme
41ab92b62f s3:lib: factor out talloc_sub_advanced() from talloc_sub_full()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-07 14:16:42 +00:00
Ralph Boehme
4736623c24 s3: rename talloc_sub_advanced() to talloc_sub_full()
We currently have the following substitution functions:

  talloc_sub_basic()
  talloc_sub_advanced()

talloc_sub_basic() currently substitutes a subset of talloc_sub_advanced().

We'll need a function X that only substitutes what talloc_sub_advanced()
substitutes *without* what talloc_sub_basic() does.

To get there rename talloc_sub_advanced() to talloc_sub_full(). A subsequent
commit will then bring back talloc_sub_advanced() as described above.

Examples with fictional replacement letters A and B. Currently:

  talloc_sub_basic:    A
  talloc_sub_advanced: AB

New:

  talloc_sub_basic:    A
  talloc_sub_advanced:  B
  talloc_sub_full:     AB

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-07 14:16:41 +00:00
Ralph Boehme
a591de2865 s3: remove unused function standard_sub_advanced()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-07 14:16:41 +00:00
Ralph Boehme
81ae199bb7 s3: replace standard_sub_advanced with talloc_sub_advanced in one place
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-07 14:16:41 +00:00
Ralph Boehme
dcb555c06a s3:printing: fix a long line
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-07 14:16:41 +00:00
Volker Lendecke
18cc62b98d vfs: Use file_id_str_buf() in vfs_delay_inject_brl_lock_timer()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov  6 21:58:52 UTC 2019 on sn-devel-184
2019-11-06 21:58:52 +00:00
Volker Lendecke
2d5aba4d86 smbd: Use struct initialization instead of ZERO_STRUCT()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
001371f45e vfs: Use file_id_str_buf() in smb_full_audit_file_id_create()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
3f80b8abac smbd: Use file_id_str_buf() in set_write_time()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
d04581bfe9 smbd: Use file_id_str_buf() in rename_open_files()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
1bbdae2234 smbd: Use file_id_str_buf() in contend_level2_oplocks_begin_default()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
56f93f2111 smbd: Use file_id_str_buf() in process_kernel_oplock_break()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
6018cc5a07 smbd: Use file_id_str_buf() in process_oplock_break_message()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
75962acade smbd: Use file_id_str_buf() in initial_break_processing()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00
Volker Lendecke
6e521461c5 smbd: Use file_id_str_buf() in downgrade_lease()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-11-06 20:36:35 +00:00