Volker Lendecke
a4f9f7c825
libsmb: Introduce helper var to cli_tree_connect_*_done()
...
README.Coding, makes it easier to debug
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:38 +00:00
Volker Lendecke
f3b2c2b5ef
libsmb: Remove cli_full_connection_creds_sess_start()
...
This contained very simple tevent_req logic, hiding that confused the
code for me when reading. Also, this change saves 3 lines...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
c31df02cb2
libsmb: Remove unused code
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
05267304bd
libsmb: Remove map_fnum_to_smb2_handle() from cli_smb2_qpathinfo2()
...
Not used
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
ffc9072fc0
libsmb: Remove map_fnum_to_smb2_handle() from cli_smb2_getatr()
...
Not used
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
767eb33480
libsmb: Correctly return ioctl error from cli_readlink()
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
ba70eb480c
libsmb: Save a few lines in cli_unix_extensions_version()
...
This is more recent style for sync wrappers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
7b96948e4d
libsmb: Add tevent_req_received() to cli_posix_readlink_recv()
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
1025349ae2
lib: Fix a typo
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
9fca3007ac
smbd: Modernize DBG statements in open_fake_file()
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
c047c6601f
libsmb: Move static strings to the .text segment
...
We don't need to copy these to the stack, this saves 200 bytes of .text
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
4df36cd170
examples: A tiny bit of README.Coding for teststat.c
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
6a74546ab8
libsmb: Tab-indent SMBC_module_[init|terminate]()
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
b93c2d5b37
libsmb: Fix a typo
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
c53d86594a
libsmb: Slightly simplify SMBC_parse_path()
...
Don't manually duplicate the talloc_strndup() functionality
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
7c26512b6d
smbd: Adapt np_[read|write]_send() to more recent tevent_req conventions
...
We usually don't do "goto post_status;" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
556e1a5ee4
examples: Make libsmbclient samples look a *bit* less ugly
...
Remove trailing whitespace, indent to tabs. Yes, this introduces long
lines, but makes review with "git show -w" trivial.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
df4c3f0f28
smbd: Save a line with tevent_req_nomem()
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
7fe12e79f9
lib: Fix a typo
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
3aa9d05ee4
dfs_server: Fix typos
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
281b00a2b9
vfs: Fix a copy&paste error
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
f05b529b0e
smbd: Adapt a call to setup_dfs_referral() to README.Coding
...
Makes it easier to handle in a debugger
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Volker Lendecke
9a1336024a
libsmbclient: Fix a typo
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Anoop C S
b7c460b902
vfs_glusterfs: Implement SMB_VFS_FSTATAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 26 17:33:15 UTC 2022 on sn-devel-184
2022-08-26 17:33:15 +00:00
Anoop C S
65f4c4e31e
vfs_glusterfs: Use glfs_fgetxattr() for SMB_VFS_GET_REAL_FILENAME_AT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
55548d7405
vfs_glusterfs: Use glfs_readlinkat() for SMB_VFS_READ_DFS_PATHAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
310a908098
vfs_glusterfs: Use glfs_symlinkat() for SMB_VFS_CREATE_DFS_PATHAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
a423520038
vfs_glusterfs: Use glfs_mknodat() for SMB_VFS_MKNODAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
21654af5a5
vfs_glusterfs: Use glfs_linkat() for SMB_VFS_LINKAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
58b6cdabc0
vfs_glusterfs: Use glfs_readlinkat() for SMB_VFS_READLINKAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
b2746eb5fa
vfs_glusterfs: Use glfs_symlinkat() for SMB_VFS_SYMLINKAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
2fa71202ab
vfs_glusterfs: Use glfs_unlinkat() for SMB_VFS_UNLINKAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
2b721ff22b
vfs_glusterfs: Use glfs_renameat() for SMB_VFS_RENAMEAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
56c4aab111
vfs_glusterfs: Use glfs_mkdirat() for SMB_VFS_MKDIRAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
184a991324
vfs_glusterfs: Use glfs_openat() for SMB_VFS_OPENAT
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:38 +00:00
Anoop C S
3425fa0daf
source3/wscript: Detect glusterfs-api with *at() calls support
...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:37 +00:00
Anoop C S
5f51fa9c07
vfs_glusterfs: Accept fsp with const qualifier
...
This is in preparation to avoid any `const` qualifier being discarded
warning with future changes to various *_at() calls which has `const
file_struct` arguments.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 16:31:37 +00:00
Douglas Bagnall
fa3f0499cc
pyglue:generate_random_[machine]_password: ValueError for bad values
...
The actual range is 14 to 255 for machine passwords, and there is a
min <= max check for both.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Aug 26 08:59:28 UTC 2022 on sn-devel-184
2022-08-26 08:59:28 +00:00
Douglas Bagnall
4f902dba33
pyglue: generate_random_[machine]_password: reject negative numbers
...
Other range errors (e.g. min > max) are caught in the wrapped
functions which returns EINVAL, so we don't recapitulate that logic
(see next commit though).
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Douglas Bagnall
b7b4d6da5f
pyglue: generate_random_bytes/str accept positive numbers only
...
We aren't yet able to generate negative numbers of random bytes.
Instead a request for -n bytes is implicitly converted into one for
SIZE_MAX - n bytes, which is typically very large. Memory exhaustion
seems a likely outcome.
With this patch callers will see a ValueError.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Douglas Bagnall
333e1efa27
pyglue: check talloc buffer for random bytes
...
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Douglas Bagnall
9aa52bb37e
pytest/segfault: abort for generate_random_bytes(-1)
...
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
9c2ffef0d5
s3:passdb: Zero sensitive memory in lsa_secret_{set/get}_common()
...
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
79754f04bb
s3:passdb: Zero secrets_domain_info1_password created via secrets_domain_info_password_create()
...
Zero out these members of struct secrets_domain_info1_password:
DATA_BLOB cleartext_blob;
struct samr_Password nt_hash;
struct secrets_domain_info1_kerberos_key *keys;
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
da2c723266
s3:passdb: Zero secrets_domain_info1_password created via secrets_fetch()
...
Zero out these members of struct secrets_domain_info1_password:
DATA_BLOB cleartext_blob;
struct samr_Password nt_hash;
struct secrets_domain_info1_kerberos_key *keys;
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
01c0ab191a
s3:passdb: Zero local memory in secrets_domain_info_kerberos_keys()
...
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
ebfc167233
s3:passdb: Zero local memory in secrets_fetch()
...
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
28a3d5119a
lib:krb5: Change memset() to BURN_PTR_SIZE()
...
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
4b2df80e89
s3:afs: Zero memory for afs_keyfile
...
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00
Pavel Filipenský
83dc061fd3
s3:net: Zero password in secrets_fetch_ipc_userpass() callers
...
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26 07:59:32 +00:00