[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Thu Dec 7 05:34:02 UTC 2023
The branch, master has been updated
via 763b2efe69d s3:utils: Fix setting the debug level
via e5fe856e76e s3:tests: Add smbget test for smb://DOAMIN;user%password@server/share/file
via 40de9033650 pycredentials: Properly check type in creds.set_nt_hash() and samr.encrypt_samr_password()
from 00034d02289 s3:auth: Allow 'Unix Users' and 'Unix Groups' to create a local token
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 763b2efe69dc74e1c0cd954607031012f832486d
Author: Andreas Schneider <asn at samba.org>
Date: Wed Dec 6 08:48:34 2023 +0100
s3:utils: Fix setting the debug level
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15525
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Thu Dec 7 05:33:21 UTC 2023 on atb-devel-224
commit e5fe856e76eba26e3b85a391bcea02dfe045c26e
Author: Andreas Schneider <asn at samba.org>
Date: Tue Dec 5 15:46:48 2023 +0100
s3:tests: Add smbget test for smb://DOAMIN;user%password@server/share/file
This is supported according to the smbget manpage!
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15525
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 40de90336506233994a57cbde7a107e26ffe22bf
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Dec 7 15:50:43 2023 +1300
pycredentials: Properly check type in creds.set_nt_hash() and samr.encrypt_samr_password()
We should not be just doing a talloc type check, we should check the python
type first.
Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Joseph Sutton <josephsutton at catalyst.net.nz>
-----------------------------------------------------------------------
Summary of changes:
auth/credentials/pycredentials.c | 10 ++++++++++
auth/credentials/wscript_build | 3 ++-
source3/script/tests/test_smbget.sh | 20 ++++++++++++++++++++
source3/utils/smbget.c | 6 +++++-
4 files changed, 37 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index 8e7d8ae7b56..a27e02d1aa5 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -568,6 +568,11 @@ static PyObject *py_creds_set_nt_hash(PyObject *self, PyObject *args)
}
obt = _obt;
+ if (!py_check_dcerpc_type(py_cp, "samba.dcerpc.samr", "Password")) {
+ /* py_check_dcerpc_type sets TypeError */
+ return NULL;
+ }
+
pwd = pytalloc_get_type(py_cp, struct samr_Password);
if (pwd == NULL) {
/* pytalloc_get_type sets TypeError */
@@ -1073,6 +1078,11 @@ static PyObject *py_creds_encrypt_samr_password(PyObject *self,
return NULL;
}
+ if (!py_check_dcerpc_type(py_cp, "samba.dcerpc.samr", "Password")) {
+ /* py_check_dcerpc_type sets TypeError */
+ return NULL;
+ }
+
pwd = pytalloc_get_type(py_cp, struct samr_Password);
if (pwd == NULL) {
/* pytalloc_get_type sets TypeError */
diff --git a/auth/credentials/wscript_build b/auth/credentials/wscript_build
index 7568554df4d..83c6e8ca5a0 100644
--- a/auth/credentials/wscript_build
+++ b/auth/credentials/wscript_build
@@ -27,12 +27,13 @@ bld.SAMBA_SUBSYSTEM('CREDENTIALS_CMDLINE',
source='credentials_cmdline.c',
deps='samba-credentials')
+pyrpc_util = bld.pyembed_libname('pyrpc_util')
pytalloc_util = bld.pyembed_libname('pytalloc-util')
pyparam_util = bld.pyembed_libname('pyparam_util')
bld.SAMBA_PYTHON('pycredentials',
source='pycredentials.c',
- public_deps='samba-credentials %s %s CREDENTIALS_CMDLINE CREDENTIALS_KRB5 CREDENTIALS_SECRETS' % (pytalloc_util, pyparam_util),
+ public_deps='samba-credentials %s %s %s CREDENTIALS_CMDLINE CREDENTIALS_KRB5 CREDENTIALS_SECRETS' % (pyrpc_util, pytalloc_util, pyparam_util),
realname='samba/credentials.so'
)
diff --git a/source3/script/tests/test_smbget.sh b/source3/script/tests/test_smbget.sh
index 46c1f4a68a5..bdc62a71eff 100755
--- a/source3/script/tests/test_smbget.sh
+++ b/source3/script/tests/test_smbget.sh
@@ -145,6 +145,22 @@ test_singlefile_smburl()
return 0
}
+test_singlefile_smburl2()
+{
+ clear_download_area
+ $SMBGET "smb://$DOMAIN;$USERNAME:$PASSWORD@$SERVER_IP/smbget/testfile"
+ if [ $? -ne 0 ]; then
+ echo 'ERROR: RC does not match, expected: 0'
+ return 1
+ fi
+ cmp --silent $WORKDIR/testfile ./testfile
+ if [ $? -ne 0 ]; then
+ echo 'ERROR: file content does not match'
+ return 1
+ fi
+ return 0
+}
+
test_singlefile_authfile()
{
clear_download_area
@@ -499,6 +515,10 @@ testit "download single file with --update and UPN" test_singlefile_U_UPN ||
testit "download single file with smb URL" test_singlefile_smburl ||
failed=$(expr $failed + 1)
+testit "download single file with smb URL including domain" \
+ test_singlefile_smburl2 ||
+ failed=$(expr $failed + 1)
+
testit "download single file with authfile" test_singlefile_authfile ||
failed=$(expr $failed + 1)
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index a43679328c1..dc8dace8a55 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -849,6 +849,7 @@ int main(int argc, char **argv)
uint32_t gensec_features;
bool use_wbccache = false;
SMBCCTX *smb_ctx = NULL;
+ int dbg_lvl = -1;
int rc;
smb_init_locale();
@@ -922,13 +923,16 @@ int main(int argc, char **argv)
samba_cmdline_burn(argc, argv);
+ /* smbc_new_context() will set the log level to 0 */
+ dbg_lvl = debuglevel_get();
+
smb_ctx = smbc_new_context();
if (smb_ctx == NULL) {
fprintf(stderr, "Unable to initialize libsmbclient\n");
ok = false;
goto done;
}
- smbc_setDebug(smb_ctx, debuglevel_get());
+ smbc_setDebug(smb_ctx, dbg_lvl);
rc = smbc_setConfiguration(smb_ctx, lp_default_path());
if (rc < 0) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list