summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* smbd: Remove share_mode_data->recordVolker Lendecke2019-11-222-9/+0
| | | | | | | In the future, there won't be a record anymore Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass the db_record down to share_mode_data_store()Volker Lendecke2019-11-221-4/+6
| | | | | | | Remove a dependency on share_mode_data->record Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_watch_send()Volker Lendecke2019-11-224-19/+20
| | | | | | | This removes some dependencies on share_mode_data->record Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add share_mode_watch_send/recvVolker Lendecke2019-11-222-0/+91
| | | | | | | | | For now this is a simple wrapper around dbwrap_watched_watch_send() that will make the direct db_record reference in struct share_mode_data unnecessary. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Don't store in-RAM cachesVolker Lendecke2019-11-221-269/+359
| | | | | | | | | | | | | | | | | | | | The history of this file is a mess with lots of bugs. Most of the bugs I believe are based on the cache of database contents we maintain in struct dbwrap_watch_rec. This patch removes that cache and does all modifications directly in the backend database. This means we have to mess with the database format in a few more places, but I think the format is simple enough that this does not really hurt. I tried for a few days to split this up into small pieces that are easier to understand, but every time I separated out individual chunks I found difficult to track down bugs that are all resolved in the final code presented here. It's more lines of code, but I hope it's more robust. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Simplify struct dbwrap_watched_watch_stateVolker Lendecke2019-11-221-82/+4
| | | | | | | | | | With the wakeup messages changed, we don't need to store what used to be the old message in the struct dbwrap_watched_watch_state anymore. We still need to store the key that is watched for removal of our watch entry in the request destructor Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Simplify the wakeup messagesVolker Lendecke2019-11-221-23/+21
| | | | | | | | | The instance ID per process globally identifies a watch instance across databases. It's not necessary to send the database ID and the watched key across, the uin64_t instance ID is sufficient. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Add a uin64_t instance to watchersVolker Lendecke2019-11-221-6/+19
| | | | | | | Initially used for debugging purposes only Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Encapsulate watchers in "struct dbwrap_watcher"Volker Lendecke2019-11-221-34/+69
| | | | | | | Next patch will extend this structure Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Prevent two watchers per fetch_locked sequenceVolker Lendecke2019-11-221-0/+4
| | | | | | | | This can lead to very confusing bugs, and the code right now does not deal with it well. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Test the next patch: No two waiters in one do_locked()Volker Lendecke2019-11-224-0/+173
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Consolidate dbwrap_watch test initializationVolker Lendecke2019-11-221-55/+74
| | | | | | | More lines, but less error-prone copy&paste Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Don't set rec->value in dbwrap_do_locked()Volker Lendecke2019-11-221-3/+0
| | | | | | | We pass that via the callback now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* locking: Remove a call to dbwrap_record_get_value()Volker Lendecke2019-11-221-4/+8
| | | | | | | | | | | | | | | This makes a copy of the record values TDB_DATA. In this case, it is okay: We only do a dbwrap_record_storev modifying the value that we retrieved from the share_mode_lock destructor. This patch is necessary because the next commit will make the "value" argument to the dbwrap_do_locked() callback the only source of the record value. Thus for a nested share_mode_do_locked() call we have to maintain the record value explicitly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Protect against invalid db_record->valueVolker Lendecke2019-11-222-0/+5
| | | | | | | | | | | After dbwrap_record_storev()/delete(), dbwrap_record_get_value() information is stale. Assert on the attempt to re-fetch data after it became stale. This can't protect against someone copying the result from dbwrap_record_get_value() somewhere else, but it's better than nothing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Use dbwrap_do_locked() in vfs_offload_token_db_store_fsp()Volker Lendecke2019-11-221-46/+63
| | | | | | | Less malloc Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Use dbwrap_parse_record() in vfs_offload_token_db_fetch_fsp()Volker Lendecke2019-11-221-24/+34
| | | | | | | Less malloc Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* g_lock: Pass "data" down to g_lock_trylock()Volker Lendecke2019-11-221-8/+8
| | | | | | | | Avoid a call to dbwrap_record_get_value(), dbwrap_do_locked() already gave us the value. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Pass "value" to dbwrap_do_locked() callbackVolker Lendecke2019-11-226-34/+57
| | | | | | | | | | | | | | I want to reduce dbwrap_record_get_value(). It makes the caller believe it can make a copy of the TDB_DATA returned and that the value remains constant. It's not, as you can always do a dbwrap_record_store(). This patch removes one requirement for getting the value out of a db_record via dbwrap_record_get_value(). You can still make a copy, but from an API perspective to me it's more obvious that "value" as a parameter to the callback has a limited lifetime. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:printing: Use httpConnect2 from CUPSAndreas Schneider2019-11-223-8/+91
| | | | | | | | | | This fixes deprecation warnings. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Nov 22 19:54:55 UTC 2019 on sn-devel-184
* build: Do not build selftest binaries for builds without --enable-selftestAndrew Bartlett2019-11-222-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new for_selftest option to SAMBA_BINARY() and SAMBA3_BINARY() This allows us to be much more consistent (at least in the core Samba) and documents clearly why the binary should not be installed. Not modified are - test_lp_load - notifyd-tests - gendrandperf - test* from examples/libsmbclient - dbwrap_torture - split_tokens - locktest2 - msgtest - msg_sink - msg_source - versiontest - rpc_open_tcp - test_headers As these are not tested in selftest so any change would also be untested. Of course they probably should be added in a different MR. Also not modified (because they are not tests, nor part of the build system) are: - smb2mount - notifydd - log2pacp - debug2html - smbfilter - destroy_netlogon_creds_cli - spotlight2* - tevent_glib_tracker These do however appear to be untested. For now, the source4 forked client tools are left unchanged: - smbclient4 - nmblookup4 Finally, the heimdal binaries are left as install=False as they are either part of the build system or end-user tools that we just don't want to install. These are however tested. The motivation is commit like c34ec003b7d45aa4196ff93a0ac29694b25e5309 and da87fa998ab71328f30bcdf5b41aee8675aee48a, which are both totally correct but are not needed if the selftest is not run on MacOS. There are likely other platforms or build environments where building our test binaries is more pain than valuable, see for example also https://lists.samba.org/archive/samba/2019-November/227137.html Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Isaac Boukris <iboukris@samba.org> Autobuild-User(master): Isaac Boukris <iboukris@samba.org> Autobuild-Date(master): Fri Nov 22 11:48:59 UTC 2019 on sn-devel-184
* vfs: Fix a typoVolker Lendecke2019-11-201-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Nov 20 15:23:10 UTC 2019 on sn-devel-184
* vfs_gpfs: Use update_stat_ex_create_timeChristof Schmitt2019-11-191-6/+13
| | | | | | | | | | | Make the code a bit easier to read by avoiding direct access to the statex struct. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Tue Nov 19 22:44:53 UTC 2019 on sn-devel-184
* vfs_gpfs: Create fileid from filesystem metadataChristof Schmitt2019-11-191-0/+54
| | | | | | | | | | | | | MacOS SMB clients require that file ids are not quickly reused when files are deleted and new files are created with the same name. Inode numbers do not satisfy that requirement, as they will be quickly reused. To address this problem, create a unique id from the available file system specific metadata. As that id is larger than the available 64bit, use a hash to generate a 64bit id for usage as fileid. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* vfs_gpfs: Use gpfs_fstat_x in vfs_gpfs_fget_dos_attributesChristof Schmitt2019-11-191-6/+8
| | | | | | | | This is no functional change, but allows to use additional metadata later on. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* vfs_gpfs: Use gpfs_stat_x in vfs_gpfs_get_dos_attributesChristof Schmitt2019-11-191-8/+13
| | | | | | | | This is no functional change, but allows to use additional metadata later on. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* vfs: Fix CID 1455914 Unused valueVolker Lendecke2019-11-191-0/+4
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Nov 19 17:37:42 UTC 2019 on sn-devel-184
* smbd: Fix CID 1455912 Logically dead codeVolker Lendecke2019-11-191-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* winbind: Fix CID 1455915 Resource leakVolker Lendecke2019-11-191-0/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* machine_account_secrets: do not generate single DES keysIsaac Boukris2019-11-191-36/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14202 Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* kerberos_keytab: do not add single DES keys to keytabIsaac Boukris2019-11-191-2/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14202 Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:winbind: Replace E_md5hash() with GnuTLS callsAndreas Schneider2019-11-191-1/+22
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:winbindd: Replace E_md5hash() with GnuTLS callsAndreas Schneider2019-11-191-1/+22
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpc_server: Replace E_md5hash() with GnuTLS callsAndreas Schneider2019-11-191-1/+19
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-build: add missing gnutls dependencyBjörn Baumbach2019-11-151-1/+4
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org>
* vfs: Use dbwrap_delete() in acl_tdb_delete()Volker Lendecke2019-11-141-30/+4
| | | | | | | | Use the wrapper function that's already available for exactly this purpose. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Use dbwrap_store() in store_acl_blob_fsp()Volker Lendecke2019-11-141-9/+4
| | | | | | | | Use the wrapper function that's already available for exactly this purpose. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Use direct struct assignment in store_acl_blob_fsp()Volker Lendecke2019-11-141-3/+1
| | | | | | | 2 lines less code Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make share_mode_do_locked() pass TDB_DATA instead of a recordVolker Lendecke2019-11-133-12/+14
| | | | | | | | | | | No callback used (and should not use) the record directly, this is all handled within share_mode_lock.c 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 13 21:41:09 UTC 2019 on sn-devel-184
* build: Only link against libcrypt where neededAndrew Bartlett2019-11-131-0/+1
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-build: Skip building the ndr_table at the tail of ndr_libnetapi.cAndrew Bartlett2019-11-131-0/+1
| | | | | | | | | | | | | | | | | 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>
* build: Allow warning on compile of libnetapi PIDLAndrew Bartlett2019-11-131-1/+2
| | | | | | | | | | | 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>
* librpc: Do not include the ndr_table for libnet_join.idl and libnetapi.idl ↵Andrew Bartlett2019-11-131-2/+9
| | | | | | | | | | | | 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>
* smbd: Remove write cacheVolker Lendecke2019-11-1316-886/+8
| | | | | | | | | | | | | | | | | 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
* lib: Remove unused file_id_string()Volker Lendecke2019-11-122-12/+0
| | | | | | | | 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
* smbd: Use file_id_str_buf() in share_mode_cleanup_disconnected()Volker Lendecke2019-11-121-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in share_mode_memcache_fetch()Volker Lendecke2019-11-121-7/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in share_mode_memcache_store()Volker Lendecke2019-11-121-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove unused file_id_string_tos()Volker Lendecke2019-11-122-12/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Use file_id_str_buf() in print_brl()Volker Lendecke2019-11-121-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>