summaryrefslogtreecommitdiff
path: root/source3/include
AgeCommit message (Collapse)AuthorFilesLines
2023-04-20s3:libsmb: Mark smbc_set_credentials() as deprecatedAndreas Schneider1-22/+17
This will issue a compiler warning! Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2023-04-09libsmb: fix regression on smbc_getxattr and fix docRemi Collet1-1/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14808 Signed-off-by: Remi Collet <rcollet@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2023-01-10lib: Add tdb_data_dbg()Volker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-01-10lib: Remove unused smb_mkstemp prototypeVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-01-10lib: Move tab_depth() to reg_parse_prs.cVolker Lendecke1-1/+0
Wow, I did not know we still use prs_struct... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-01-10lib: Make map_share_mode_to_deny_mode() static to smbstatusVolker Lendecke1-1/+0
At some point in the future this might disappear, we should really not show DOS share modes in smbstatus. Maybe this can't be changed though. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-01-10smbd: Make get_safe_[[SI]VAL|ptr] static to smb1_lanman.cVolker Lendecke1-3/+0
SMB1-specific, only used there. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-01-04smbd: Remove duplicate/unused #definesVolker Lendecke1-9/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-01Happy New Year 2023!Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sun Jan 1 00:24:02 UTC 2023 on sn-devel-184
2022-12-19smbd/locking: make use of the same tdb hash_size and flags for all SMB ↵Stefan Metzmacher1-2/+6
related tdb's It's good to have a consistent set of hash_size/flags for all aspects of an open file handle. Currently we're using 4 databases: smbXsrv_open_global.tdb, leases.tdb, locking.tdb and brlock.tdb. While at it also crank up the hashsize if the smbXsrv_tcon and smbXsrv_session TDBs. The default TDB hash size is insanely small and disk space is cheap these days, by going with the much larger hash size we get O(1) lookup instead of O(n) for moderate to large loads with a few thousand objects. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Dec 19 16:40:15 UTC 2022 on sn-devel-184
2022-12-16s3-librpc: add ads.idl and convert ads_struct to talloc.Günther Deschner1-86/+4
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14smbd: Remove source3/smbd/statcache.cVolker Lendecke1-2/+0
After I found that nobody calls stat_cache_add() anymore, there was no reason to keep the rest of statcache.c. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14vfs: Fix whitespaceVolker Lendecke1-5/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14smbd: remove process shortname arg from reinit_after_fork()Ralph Boehme1-2/+1
All callers pass NULL anyway, so it isn't used anymore. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14smbd: remove process shortname arg from smbd_reinit_after_fork()Ralph Boehme1-2/+1
All callers already do this explicitly by calling process_set_title(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-12lib: Remove unused octal_string()Volker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-12lib: Remove fstring_sub() that was used just onceVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-11-29smbd: Implement SMB2_FS_POSIX_INFORMATION_INTERNALDavid Mulder1-0/+1
Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2022-11-29libcli: Add client support for SMB2_FILE_POSIX_INFORMATIONDavid Mulder1-0/+7
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2022-11-10lib: Add lp_allow_local_address()Volker Lendecke1-0/+2
Helper function for listing and accessing shares Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-10-27lib: Whitespace fixesVolker Lendecke1-4/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-10-27lib: Remove two unused macrosVolker Lendecke1-6/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-20s3:g_lock: add callback function to g_lock_lock()Stefan Metzmacher1-1/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-20s3:g_lock: add callback function to g_lock_lock_send()Stefan Metzmacher1-1/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-20s3:g_lock: add g_lock_lock_cb_state infrastructureStefan Metzmacher1-0/+27
This prepares some helper functions in order to allow callers of g_lock_lock() to pass in a callback function that will run under the tdb chainlock when G_LOCK_WRITE was granted. The idea is that the callers callback function would only be allowed to run these new helper functions, while all key based function are not to be allowed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-20s3:smbd: add helpers to deny vfs calls in some sectionsStefan Metzmacher1-0/+12
Code denying vfs calls can do: { struct smb_vfs_deny_state vfs_deny = {}; smb_vfs_deny_push(&vfs_deny); VFS calls are not allowed here... smb_vfs_deny_pop(&vfs_deny); } This will allow us to safely run some code under a tdb chainlock later... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-20s3:smbd: move VFS_FIND() to smbd/vfs.cStefan Metzmacher1-4/+0
It's only used there... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-19lib: Move extract_snapshot_token() to util_path.cVolker Lendecke1-12/+0
Make it available to replace clistr_is_previous_version_path() in libsmb/ Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-17vfs: Add dirfsp to connectpath_fn()Volker Lendecke2-7/+12
So far we only call CONNECTPATH on full paths. In the future, we'll have a call that will not have converted a relative path to absolute just for efficiency reasons. To give shadow_copy2 the chance to still find the snapshot directory, pass the dirfsp down to it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-02libsmb: Allow to request SMB311 posix in source3/libsmbVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-29smbd: cache DOS attributes in struct smb_filename.cached_dos_attributesRalph Boehme2-0/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14215 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26libsmbclient: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-22smbd: add and use vfs_fget_dos_attributes()Ralph Boehme1-0/+3
Commit d71ef1365cdde47aeb3465699181656b0655fa04 caused a regression where the creation date on streams wasn't updated anymore on the stream fsp. By adding a simple wrapper vfs_fget_dos_attributes() that takes care of - passing only the base_fsp to the VFS, so the VFS can be completely agnostic of all the streams related complexity like fake fds, - propagating any updated btime from the base_fsp->fsp_name to the stream_fsp->fsp_name BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126 MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-08-19s3:g_lock: add some const to the shared array passed via g_lock_dump*()Stefan Metzmacher1-2/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-16s3:vfs.h: change SMB_VFS_INTERFACE_VERSION to 48 for 4.18Stefan Metzmacher1-1/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Aug 16 11:51:36 UTC 2022 on sn-devel-184
2022-08-16s3:vfs.h: add comment about VFS_OPEN_HOW_RESOLVE_NO_SYMLINKSStefan Metzmacher1-0/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-15vfs: define VFS_OPEN_HOW_RESOLVE_NO_SYMLINKSVolker Lendecke1-0/+3
This will allow us to make use of openat2(RESOLVE_NO_SYMLINKS) soon. The caller should check if connection_struct.open_how_resolve contains VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS before using it, this avoids waisting cpu time. But even then the caller must be prepared to handle -1/ENOSYS. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2022-08-12s3: smbd: Remove definition of struct dfs_path.Jeremy Allison1-7/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-11s3:include: remove unused update_stat_ex_file_id() prototypeStefan Metzmacher1-1/+0
It was removed by commit 643da37fd139413651a6198fb0f6e550f7de6584 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-08s3:passdb: Remove unused function secrets_fetch_trust_account_password()Pavel Filipenský1-3/+0
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 8 19:03:08 UTC 2022 on sn-devel-184
2022-08-08s3:include: Fix trailing whitespaces in secrets.hPavel Filipenský1-5/+5
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-06vfs: Add struct vfs_open_how.resolveVolker Lendecke1-0/+1
This prepares the later introduction of VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS, which will be used to make use of RESOLVE_NO_SYMLINKS on linux with openat2(). Right now all terminal VFS objects reject any resolve bits with ENOSYS. So we only prepare the vfs layer for now without any real change. But this will make backports to 4.17 much easier. Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Aug 6 02:39:11 UTC 2022 on sn-devel-184
2022-08-06vfs: change openat propotype to match linux openat2Volker Lendecke2-10/+15
The Linux prototype for openat2 looks like this: long openat2(int dirfd, const char *pathname, struct open_how *how, size_t size); where "struct open_how" is defined in "linux/openat2.h". It is designed to be extensible with further flags. The "size" parameter is required because there is no type checking between userland and kernelspace, so the way for Linux to find which version of open_how is being passed in is looking at the size: "open_how" is expected to only every grow with additional fields, should a change be necessary in the future. Samba does not have this problem, we can typecheck the struct and pointers, we expect all VFS modules to be compiled against the current vfs.h. For now this adds no functionality, but it will make further patches much smaller. Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-05s3: smbd: Remove 'bool posix_path' from struct dfs_path.Jeremy Allison1-1/+0
Nothing now sets or looks at it. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2022-07-27CVE-2022-32742: s3: smbd: Harden the smbreq_bufrem() macro.Jeremy Allison1-1/+1
Fixes the raw.write.bad-write test. NB. We need the two (==0) changes in source3/smbd/smb2_reply.c as the gcc optimizer now knows that the return from smbreq_bufrem() can never be less than zero. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15085 Remove knownfail. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Jule Anger <janger@samba.org> Autobuild-Date(master): Wed Jul 27 11:46:46 UTC 2022 on sn-devel-184
2022-06-27s3:libads: Remove no longer used is_mine flag from ADS_STRUCTSamuel Cabrero1-2/+0
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-06vfs: Remove a typedefVolker Lendecke1-2/+2
We want to get rid of struct typedefs, and this was quick Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-06smbd: Remove NTCREATEX_FLAG_DELETE_ON_CLOSEVolker Lendecke1-3/+0
This is only used for print files. Storing it in the fd_handle seems overkill to me, this can easily be stored directly in the fsp itself, we have a flag for this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-06smbd: Remove unused smb_bufrem() macroVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-06s3:include fix typoChristian Ambach1-1/+1
Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>