[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6ee3f809a54 s3/smbd: If we fail to close file_handle ensure we should reset the fd via 6e6324cff29 smbd: simplify handling of failing fstat() after unlinking file from 78208d4fe47 ctdb: Remove an unnecessary cast https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6ee3f809a54d7b833ff798e68a93ada00a215d4d Author: Noel Power Date: Tue Feb 20 09:26:29 2024 + s3/smbd: If we fail to close file_handle ensure we should reset the fd if fsp_flags.fstat_before_close == true then close_file_smb will call vfs_stat which can fail. If it does fail then the fd associated with the file handle will still be set (and we will hit an assert is the file handle destructor) when calling file_free. We need to set fd to -1 to avoid that. To achieve that we capture and return the vfs_stat_fsp failure status while still processing the rest of the fd_close logic. [2024/02/20 09:23:48.454671, 0, pid=9744] ../../source3/smbd/smb2_close.c:226(smbd_smb2_close) smbd_smb2_close: close_file[]: NT_STATUS_ACCESS_DENIED [2024/02/20 09:23:48.454757, 0, pid=9744] ../../source3/smbd/fd_handle.c:40(fd_handle_destructor) PANIC: assert failed at ../../source3/smbd/fd_handle.c(40): (fh->fd == -1) || (fh->fd == AT_FDCWD) [2024/02/20 09:23:48.454781, 0, pid=9744] ../../lib/util/fault.c:178(smb_panic_log) === [2024/02/20 09:23:48.454804, 0, pid=9744] ../../lib/util/fault.c:185(smb_panic_log) INTERNAL ERROR: assert failed: (fh->fd == -1) || (fh->fd == AT_FDCWD) in smbd (smbd[192.168.10) (client [192.168.100.15]) pid 9744 (4.21.0pre1-DEVELOPERBUILD) [2024/02/20 09:23:48.454844, 0, pid=9744] ../../lib/util/fault.c:190(smb_panic_log) If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting [2024/02/20 09:23:48.454869, 0, pid=9744] ../../lib/util/fault.c:191(smb_panic_log) BUG: https://bugzilla.samba.org/show_bug.cgi?id=15527 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Mar 13 10:34:45 UTC 2024 on atb-devel-224 commit 6e6324cff29089a636823786183222a73fe7cb28 Author: Ralph Boehme Date: Mon Feb 5 15:03:48 2024 +0100 smbd: simplify handling of failing fstat() after unlinking file close_remove_share_mode() already called vfs_stat_fsp(), so we can skip the fstat() triggered in fd_close() by fsp->fsp_flags.fstat_before_close being true. This avoids getting an EACCESS error when doing an fstat() on the removed file which seems to happen with some FUSE filesystems. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15527 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- Summary of changes: source3/smbd/close.c | 1 + source3/smbd/open.c | 27 --- 2 files changed, 9 insertions(+), 19 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 538435ca834..bbca474a28a 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -603,6 +603,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, */ fsp->fsp_flags.delete_on_close = false; + fsp->fsp_flags.fstat_before_close = false; lck_state.reset_delete_on_close = true; done: diff --git a/source3/smbd/open.c b/source3/smbd/open.c index e63ebf2e7c6..bd397376d26 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -943,7 +943,7 @@ NTSTATUS fd_openat(const struct files_struct *dirfsp, NTSTATUS fd_close(files_struct *fsp) { - NTSTATUS status; + NTSTATUS stat_status = NT_STATUS_OK; int ret; if (fsp == fsp->conn->cwd_fsp) { @@ -951,23 +951,12 @@ NTSTATUS fd_close(files_struct *fsp) } if (fsp->fsp_flags.fstat_before_close) { - status = vfs_stat_fsp(fsp); - if (!NT_STATUS_IS_OK(status)) { - /* -* If this is a stream and delete-on-close was set, the -* backing object (an xattr from streams_xattr) might -* already be deleted so fstat() fails with -* NT_STATUS_NOT_FOUND. So if fsp refers to a stream we -* ignore the error and only bail for normal files where -* an fstat() should still work. NB. We cannot use -* fsp_is_alternate_stream(fsp) for this as the base_fsp -
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via bdd739c1adb s3: winbindd: assign rangenum member after NULL check via 205866a1952 s3: winbindd: reduce scope of a variable via cde71074e01 s3: winbindd: remove double initialization from dd9b11acbc4 ctdb-protocol: Add missing push support for new controls https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit bdd739c1adb78f9b484b31100d9903408a7068ba Author: Shaleen Bathla Date: Wed Feb 21 18:55:28 2024 +0530 s3: winbindd: assign rangenum member after NULL check if we are doing NULL check for range, then we should assign its member after the NULL check. Signed-off-by: Shaleen Bathla Reviewed-by: Volker Lendecke Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Feb 22 10:57:38 UTC 2024 on atb-devel-224 commit 205866a1952b2bf1aff5a1abed25b7149e442799 Author: Shaleen Bathla Date: Wed Feb 21 18:38:45 2024 +0530 s3: winbindd: reduce scope of a variable reduce scope of variable as a best practice Signed-off-by: Shaleen Bathla Reviewed-by: Volker Lendecke Reviewed-by: Noel Power commit cde71074e0145a76ea1b34a318e76bbc0450d90f Author: Shaleen Bathla Date: Wed Feb 21 18:26:11 2024 +0530 s3: winbindd: remove double initialization remove re-initialization of entry variable in for loop Signed-off-by: Shaleen Bathla Reviewed-by: Volker Lendecke Reviewed-by: Noel Power --- Summary of changes: source3/winbindd/idmap_autorid_tdb.c | 3 ++- source3/winbindd/nss_info.c | 2 +- source3/winbindd/winbindd_rpc.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/idmap_autorid_tdb.c b/source3/winbindd/idmap_autorid_tdb.c index 6c76764076a..68c4d2f3355 100644 --- a/source3/winbindd/idmap_autorid_tdb.c +++ b/source3/winbindd/idmap_autorid_tdb.c @@ -97,7 +97,6 @@ static NTSTATUS idmap_autorid_addrange_action(struct db_context *db, ctx = (struct idmap_autorid_addrange_ctx *)private_data; range = ctx->range; acquire = ctx->acquire; - requested_rangenum = range->rangenum; if (db == NULL) { DEBUG(3, ("Invalid database argument: NULL\n")); @@ -109,6 +108,8 @@ static NTSTATUS idmap_autorid_addrange_action(struct db_context *db, return NT_STATUS_INVALID_PARAMETER; } + requested_rangenum = range->rangenum; + DEBUG(10, ("Adding new range for domain %s " "(domain_range_index=%"PRIu32")\n", range->domsid, range->domain_range_index)); diff --git a/source3/winbindd/nss_info.c b/source3/winbindd/nss_info.c index 9c502e84ef0..3b58ca29324 100644 --- a/source3/winbindd/nss_info.c +++ b/source3/winbindd/nss_info.c @@ -32,7 +32,7 @@ static struct nss_domain_entry *nss_domain_list = NULL; static struct nss_function_entry *nss_get_backend(const char *name ) { - struct nss_function_entry *entry = backends; + struct nss_function_entry *entry = NULL; for(entry = backends; entry; entry = entry->next) { if ( strequal(entry->name, name) ) diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index 2b4a47e223d..ef015b2fbf2 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -323,7 +323,6 @@ NTSTATUS rpc_lookup_useraliases(TALLOC_CTX *mem_ctx, uint32_t **palias_rids) { #define MAX_SAM_ENTRIES_W2K 0x400 /* 1024 */ - uint32_t num_query_sids = 0; uint32_t num_queries = 1; uint32_t num_aliases = 0; uint32_t total_sids = 0; @@ -337,6 +336,7 @@ NTSTATUS rpc_lookup_useraliases(TALLOC_CTX *mem_ctx, do { /* prepare query */ struct lsa_SidArray sid_array; + uint32_t num_query_sids = 0; ZERO_STRUCT(sid_array); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 9b2f2302ee4 s3/rpc_client: cleanup unmarshalling of variant types from row columns via 6ecb614b8ec s3/utils: use full 64 bit address for getrows (with 64bit offsets) via efa60ff3105 s3/rpc_client: Remove stray unnecessary comment via a61eb703289 s3/rpc_client: change type of offset to uint64_t via 718c411201b librpc/idl: remove duplicate definitition via 3d063f212f6 librpc/idl: fix typo in wsp_csort member via d097c38992e librpc/wsp: Unknown property used in 'current directory' searches from a48f8ae3077 docs-xml: Build and install man page for wspsearch https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 9b2f2302ee4828ae54f5903a3bf649ffd255fb4a Author: Noel Power Date: Wed Jan 10 14:43:58 2024 + s3/rpc_client: cleanup unmarshalling of variant types from row columns Prior to this change fn 'extract_variant_addresses' actually returns offsets to the variant stored not the addresses, additionally the param in the signature of the method is named offset where the param in reality is a base address. This change makes fn 'extract_variant_addresses' actually return addresses instead of offsets and also changes the name of the incoming param. The resulting changes are propaged to callers which hopefully makes what the code is actually doing a little clearer Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jan 30 17:22:37 UTC 2024 on atb-devel-224 commit 6ecb614b8ec6953ba15e8061fce9b395615b035a Author: Noel Power Date: Mon Jan 8 15:56:38 2024 + s3/utils: use full 64 bit address for getrows (with 64bit offsets) if 64bit offsets are used the hi 32-bits of address are stored in the ulreserved2 member of the message header field and the low 32-bits are stored in the ulclientbase member of the cpmgetrows message Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit efa60ff3105ac806d2a5d82dd0615ddb7578 Author: Noel Power Date: Wed Jan 10 10:59:23 2024 + s3/rpc_client: Remove stray unnecessary comment Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit a61eb7032896265eaef3ba225aafd6f293e7569d Author: Noel Power Date: Mon Jan 8 15:12:35 2024 + s3/rpc_client: change type of offset to uint64_t Offset can be a 32 or 64 bit address depending on the indexing addressing mode negotiated by the client With a 32 bit param we can only specify a 32 bit base address. This change alone doesn't affect anything as it is the client itself that choses and passes the base address offset and wspsearch is the only current user of this code. In this case even with 64bit addressing negotiated the address passed represents only the lower 32-bits part of the address. However, for coverage purposes it would be better for the client to use an address that covers the full 64bit range of the address (when 64 bit addressing is negotiated). This change will alow the wspsearch client in a future commit to pass a base address value with both the hi and low 32 bits values set to make up the full 64 bit address. Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit 718c411201bfddc16497472c1b245bfcc29366f2 Author: Noel Power Date: Tue Dec 19 11:35:58 2023 + librpc/idl: remove duplicate definitition Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit 3d063f212f6c3dd2a5450884c06794c23dc98d09 Author: Noel Power Date: Thu Nov 16 09:22:56 2023 + librpc/idl: fix typo in wsp_csort member Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit d097c38992ea1bed038cc918727842c679126bb7 Author: Noel Power Date: Mon Dec 18 11:37:38 2023 + librpc/wsp: Unknown property used in 'current directory' searches This property seems to be used instead of 'Scope' when the windows search UI has selected current dir Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- Summary of changes: librpc/idl/wsp.idl | 9 ++ librpc/wsp/extra-props.csv | 4 +++ source3/rpc_client/wsp_cli.c | 71 source3/utils/wspsearch.c| 22 -- 4 files changed, 65 insertions(+), 41 deletions(-) Changeset truncated at 500 lines: diff --git a/librpc/idl/wsp.idl b/librpc/idl/wsp.idl index 4ae81d7247d..fceaf0a85f2 100644 --- a/librpc/idl/wsp.idl +++ b/librpc/idl/wsp.idl @@ -379,7 +379,7 @@ interface msftewds /* MS-WSP 2.2.1.10 CSort */ typedef [public] struct { - uint32 pidcolimn
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6830b796ac8 s3:/winbindd: remove parse_domain_user_fstr via 5640d7ab6c9 s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr via b4bdd341a71 s3/winbindd: replace use of parse_domain_user_fstr with parse_domain_user via 89fb5eee53c s3/winbindd: replace parse_domain_user_fn with parse_domain_user via b5427ef86bb s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr via 9d5652ec021 s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr via f734b1b2fca s3/winbindd: use parse_domain_user_fstr instead of parse_domain_user via d4341d48842 s3/winbindd: Add new parse_domain_user function via 87a919082b9 s3/winbindd: rename parse_domain_user to parse_domain_user_fstr via c6fe21e138d s3/winbindd: remove canonicalize_username_fstr via d1beafe7ccf s3/winbindd: in winbindd_pam_chauthtok_send use canonicalize_username via be6ed28f02f s3/winbindd: in winbindd_pam_auth_send use canonicalize_username via 85e8d33a33c s3/winbindd: in winbindd_pam_logoff_send use canonicalize_username via aa3febfddc7 s3/winbindd: in winbindd_ccache_save use canonicalize_username via 2e06bf9feb3 s3/winbindd: Add new canonicalize_username function via 7e1f210b9af s3/winbindd: rename canonicalize_username to canonicalize_username_fstr via 9267d9b2683 s3/winbind: Ensure parse_domain_user() can't write beyond the end of domain[] from 3f4f80edba2 smb2_server: monitor connections with TEVENT_FD_ERROR https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6830b796ac8937c8171f8f834c17f0cb7acf68b5 Author: Noel Power Date: Mon Oct 23 15:12:39 2023 +0100 s3:/winbindd: remove parse_domain_user_fstr Last caller of parse_domain_user_fstr has been removed so we can safely remove the function Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Oct 24 13:47:16 UTC 2023 on atb-devel-224 commit 5640d7ab6c9ba3928a7ee79503977ffcb263c3da Author: Noel Power Date: Mon Oct 23 15:09:25 2023 +0100 s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr In canonicalize_username replace use of parse_domain_user_fstr with parse_domain_user Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider commit b4bdd341a71e26008d1b69663bb625f491fd08c9 Author: Noel Power Date: Fri Oct 20 12:36:35 2023 +0100 s3/winbindd: replace use of parse_domain_user_fstr with parse_domain_user Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider commit 89fb5eee53c969f8375238e52dbe04f3d9568fe5 Author: Noel Power Date: Fri Oct 20 12:22:10 2023 +0100 s3/winbindd: replace parse_domain_user_fn with parse_domain_user In winbindd_getgrnam_send use parse_domain_user instead of parse_domain_user_fstr Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider commit b5427ef86bb1912ef5509141342e1a5c5ab074d7 Author: Noel Power Date: Fri Oct 20 12:10:37 2023 +0100 s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr In winbindd_ccache_ntlm_auth replace use of parse_domain_user_fstr with parse_domain_user Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider commit 9d5652ec021f7bcdeac95a31810ddcf8eaf6c9f4 Author: Noel Power Date: Fri Oct 20 12:09:17 2023 +0100 s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr in winbindd_getpwnam_send replace parse_domain_user_fstr with parse_domain_user Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider commit f734b1b2fcad1d77a1aab83f999f86c8eb3f15f6 Author: Noel Power Date: Fri Oct 20 11:53:10 2023 +0100 s3/winbindd: use parse_domain_user_fstr instead of parse_domain_user in winbindd_getgroups_send replace parse_domain_user_fstr with parse_domain_user Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider commit d4341d4884244b6dbc7cce8f0ef150964fcacc86 Author: Noel Power Date: Fri Oct 20 11:46:56 2023 +0100 s3/winbindd: Add new parse_domain_user function Adds a new parse_domain_user function which doesn't use fstrings but instead uses talloc allocated out strings (created from passed in ctx) Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider commit 87a919082b9981b6dfac1b99f8982c01a19931d5 Author: Noel Power Date: Sat Oct 21 21:35:06 2023 +0100 s3/winbindd
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4145bfb1b5a s3: smbd: Ensure init_smb1_request() zeros out what the incoming pointer points to. via c32df3bb31c s3: torture: Add SMB1-NEGOTIATE-TCON that shows the SMB1 server crashes on the uninitialized req->session. via f02f74e931f s3: smbd: init_smb1_request() isn't being passed zero'ed memory from any codepath. from dc7b48c4043 ctdb-common: Set immediate mode for pcap capture https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4145bfb1b5a3639caf26a310d612aec29fc00117 Author: Jeremy Allison Date: Fri Aug 11 17:28:53 2023 -0700 s3: smbd: Ensure init_smb1_request() zeros out what the incoming pointer points to. Remove the now unneeded req->xxx = NULL assignments (and the deliberately bogus req->session = (void *)0xDEADBEEF one used to demonstrate the bug). Remove knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15432 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Aug 15 12:06:36 UTC 2023 on atb-devel-224 commit c32df3bb31ce6275cfb91107e34e2d6b3c2fba1b Author: Jeremy Allison Date: Fri Aug 11 17:18:26 2023 -0700 s3: torture: Add SMB1-NEGOTIATE-TCON that shows the SMB1 server crashes on the uninitialized req->session. Found by Robert Morris . Adds knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15432 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit f02f74e931f5821c7b7c1be2b8f0fb60c9a69b19 Author: Jeremy Allison Date: Fri Aug 11 17:14:38 2023 -0700 s3: smbd: init_smb1_request() isn't being passed zero'ed memory from any codepath. If a client does a SMB1 NEGPROT followed by SMB1 TCON then req->session is left uninitialized. Show this causes a crash by deliberately initializing req->session to an invalid pointer. This will be removed once the test shows the crash, and the fix is added to cause init_smb1_request() to zero the memory passed in. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15432 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/selftest/tests.py | 11 +++ source3/smbd/smb2_process.c | 7 ++- source3/torture/torture.c | 40 3 files changed, 53 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 8c9ed71c6f7..9d77c49ed48 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -241,6 +241,17 @@ plantestsuite("samba3.smbtorture_s3.smb1.SMB1-NEGOTIATE-EXIT", smbtorture3, "-mNT1"]) +plantestsuite("samba3.smbtorture_s3.smb1.SMB1-NEGOTIATE-TCON", +"fileserver_smb1", +[os.path.join(samba3srcdir, + "script/tests/test_smbtorture_s3.sh"), +'SMB1-NEGOTIATE-TCON', +'//$SERVER_IP/tmp', +'$USERNAME', +'$PASSWORD', +smbtorture3, +"-mNT1"]) + # # MSDFS attribute tests. # diff --git a/source3/smbd/smb2_process.c b/source3/smbd/smb2_process.c index 923810eeff6..d55f80646ac 100644 --- a/source3/smbd/smb2_process.c +++ b/source3/smbd/smb2_process.c @@ -731,6 +731,8 @@ bool init_smb1_request(struct smb_request *req, return false; } + *req = (struct smb_request) { .cmd = 0}; + req->request_time = timeval_current(); now = timeval_to_nttime(>request_time); @@ -749,16 +751,12 @@ bool init_smb1_request(struct smb_request *req, req->encrypted = encrypted; req->sconn = sconn; req->xconn = xconn; - req->conn = NULL; if (xconn != NULL) { status = smb1srv_tcon_lookup(xconn, req->tid, now, ); if (NT_STATUS_IS_OK(status)) { req->conn = tcon->compat; } } - req->chain_fsp = NULL; - req->smb2req = NULL; - req->chain = NULL; req->posix_pathnames = lp_posix_pathnames(); /* Ensure we have at least wct words and 2 bytes of bcc. */ @@ -778,7 +776,6 @@ bool init_smb1_request(struct smb_request *req, return false; } - req->outbuf = NULL; return true; } diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 1e496e74456..2a8b8dec22f 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -14999,6 +14999,42 @@ static bool run_smb1_negotia
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d79d0508a4b s3: smbd: Add missing 'return;'s in exit paths in reply_exit_done(). via 63895e03c4e s3: torture: Add a test doing an SMB1 negotiate+exit. from 044cb8f9d55 mdssvc: Do an early talloc_free() in _mdssvc_open() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d79d0508a4b8bdc4582a350d109181ecae0bf1e2 Author: Jeremy Allison Date: Fri Aug 11 15:19:01 2023 -0700 s3: smbd: Add missing 'return;'s in exit paths in reply_exit_done(). Remove knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15430 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Aug 14 19:52:49 UTC 2023 on atb-devel-224 commit 63895e03c4e8ed79a3b2cda928f58ec278cd6608 Author: Jeremy Allison Date: Fri Aug 11 15:12:05 2023 -0700 s3: torture: Add a test doing an SMB1 negotiate+exit. Robert Morris noticed a missing return in reply_exit_done(). Adds knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15430 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/selftest/tests.py | 11 +++ source3/smbd/smb1_reply.c | 2 + source3/torture/torture.c | 181 ++ 3 files changed, 194 insertions(+) Changeset truncated at 500 lines: diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 579ed87656d..8c9ed71c6f7 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -230,6 +230,17 @@ plantestsuite("samba3.smbtorture_s3.smb1.SMB1-TRUNCATED-SESSSETUP", smbtorture3, "-mNT1"]) +plantestsuite("samba3.smbtorture_s3.smb1.SMB1-NEGOTIATE-EXIT", +"fileserver_smb1", +[os.path.join(samba3srcdir, + "script/tests/test_smbtorture_s3.sh"), +'SMB1-NEGOTIATE-EXIT', +'//$SERVER_IP/tmp', +'$USERNAME', +'$PASSWORD', +smbtorture3, +"-mNT1"]) + # # MSDFS attribute tests. # diff --git a/source3/smbd/smb1_reply.c b/source3/smbd/smb1_reply.c index 8139436aa38..f685be8016e 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -5005,6 +5005,7 @@ static void reply_exit_done(struct tevent_req *req) reply_force_doserror(smb1req, ERRSRV, ERRinvnid); smb_request_done(smb1req); END_PROFILE(SMBexit); + return; } /* @@ -5044,6 +5045,7 @@ static void reply_exit_done(struct tevent_req *req) reply_force_doserror(smb1req, ERRSRV, ERRinvnid); smb_request_done(smb1req); END_PROFILE(SMBexit); + return; } close_file_free(NULL, , SHUTDOWN_CLOSE); } diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 59ef401197d..1e496e74456 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -14822,6 +14822,183 @@ static bool run_smb1_truncated_sesssetup(int dummy) return true; } +struct smb1_negotiate_exit_state { + int dummy; +}; + +static void smb1_negotiate_exit_done(struct tevent_req *subreq); + +static struct tevent_req *smb1_negotiate_exit_send( + TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct smbXcli_conn *conn) +{ + struct smb1_negotiate_exit_state *state = NULL; + struct tevent_req *req = NULL; + struct tevent_req *subreq = NULL; + + req = tevent_req_create(mem_ctx, + , + struct smb1_negotiate_exit_state); + if (req == NULL) { + return NULL; + } + subreq = smb1cli_req_send(state, ev, conn, + SMBexit, + 0, /* additional_flags */ + 0, /* clear_flags */ + 0, /* additional_flags2 */ + 0, /* clear_flags2 */ + 1, /* timeout_msec */ + getpid(), + NULL, /* tcon */ + NULL, /* session */ + 0, /* wct */ + NULL, + 0, + NULL); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subr
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 044cb8f9d55 mdssvc: Do an early talloc_free() in _mdssvc_open() from 5379b8d557a s3: smbd: Ensure all callers to srvstr_pull_req_talloc() pass a zeroed-out dest pointer. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 044cb8f9d558bfcd7658cae0f05ff36330538748 Author: Jones Syue Date: Mon Aug 7 17:08:29 2023 +0800 mdssvc: Do an early talloc_free() in _mdssvc_open() Environment setup: When macOS Finder connect to a samba server with 'spotlight = yes', macOS would issue mdssvc open (mdssvc.opnum == 0) to samba and it goes through api _mdssvc_open(). After applied 578e434a94147dc2d7dbfc006d2ab84807859c1d, (this is reported by jay...@qnap.com) this line 'talloc_free(path);' is deleted if _mdssvc_open() normal exit, so memory is lazy de-allocate: delayed to smbd_tevent_trace_callback() @ smb2_process.c. [1] Supposed to explicitly free 'path' in _mdssvc_open() @ srv_mdssvc_nt.c[2] just like abnormal exit, do not wait for main loop to free 'path' which is no longer used, this is more consistent while reading source code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15449 [1] gdb tracing 'path' address 0x56204ccc67e0 to know how it is freed. Breakpoint 2, _tc_free_children_internal (tc=0x56204ccc6780, ptr=0x56204ccc67e0, location=0x7ff430d96410 "../../lib/talloc/talloc.c:1714") at ../../lib/talloc/talloc.c:1656 1656while (tc->child) { (gdb) bt 0 _tc_free_children_internal (tc=0x56204ccc6780, ptr=0x56204ccc67e0, location=0x7ff430d96410 "../../lib/talloc/talloc.c:1714") at ../../lib/talloc/talloc.c:1656 1 0x7ff430d92b14 in _tc_free_internal (tc=0x56204ccc6780, location=0x7ff430d96410 "../../lib/talloc/talloc.c:1714") at ../../lib/talloc/talloc.c:1183 2 0x7ff430d93b71 in _tc_free_children_internal (tc=0x56204ccc6720, ptr=0x56204ccc6780, location=0x7ff430d96410 "../../lib/talloc/talloc.c:1714") at ../../lib/talloc/talloc.c:1668 3 0x7ff430d93d66 in talloc_free_children (ptr=0x56204ccc6780) at ../../lib/talloc/talloc.c:1714 4 0x7ff432235aca in talloc_pop (frame=0x56204ccc6780) at ../../lib/util/talloc_stack.c:125 5 0x7ff430d92959 in _tc_free_internal (tc=0x56204ccc6720, location=0x7ff431f358d0 "../../source3/smbd/process.c:3726") at ../../lib/talloc/talloc.c:1157 6 0x7ff430d92cd5 in _talloc_free_internal (ptr=0x56204ccc6780, location=0x7ff431f358d0 "../../source3/smbd/process.c:3726") at ../../lib/talloc/talloc.c:1247 7 0x7ff430d93f96 in _talloc_free (ptr=0x56204ccc6780, location=0x7ff431f358d0 "../../source3/smbd/process.c:3726") at ../../lib/talloc/talloc.c:1791 8 0x7ff431d81292 in smbd_tevent_trace_callback (point=TEVENT_TRACE_AFTER_LOOP_ONCE, private_data=0x7ffe46591e30) at ../../source3/smbd/process.c:3726 <...cut...> [2] gdb tracing 'path' address 0x55a6d66deed0 to know how it is freed. Breakpoint 2, _tc_free_children_internal (tc=0x55a6d66deed0, ptr=0x55a6d66def30, location=0x7fc4cca84040 "../../source3/rpc_server/mdssvc/srv_mdssvc_nt.c:189") at ../../lib/talloc/talloc.c:1656 1656while (tc->child) { (gdb) bt 0 _tc_free_children_internal (tc=0x55a6d66deed0, ptr=0x55a6d66def30, location=0x7fc4cca84040 "../../source3/rpc_server/mdssvc/srv_mdssvc_nt.c:189") at ../../lib/talloc/talloc.c:1656 1 0x7fc4cb892b14 in _tc_free_internal (tc=0x55a6d66deed0, location=0x7fc4cca84040 "../../source3/rpc_server/mdssvc/srv_mdssvc_nt.c:189") at ../../lib/talloc/talloc.c:1183 2 0x7fc4cb892cd5 in _talloc_free_internal (ptr=0x55a6d66def30, location=0x7fc4cca84040 "../../source3/rpc_server/mdssvc/srv_mdssvc_nt.c:189") at ../../lib/talloc/talloc.c:1247 3 0x7fc4cb893f96 in _talloc_free (ptr=0x55a6d66def30, location=0x7fc4cca84040 "../../source3/rpc_server/mdssvc/srv_mdssvc_nt.c:189") at ../../lib/talloc/talloc.c:1791 4 0x7fc4cc9396e4 in _mdssvc_open (p=0x55a6d66d5600, r=0x55a6d66edc60) at ../../source3/rpc_server/mdssvc/srv_mdssvc_nt.c:189 <...cut...> Signed-off-by: Jones Syue Reviewed-by: Noel Power Reviewed-by: Volker Lendecke Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Aug 14 18:11:37 UTC 2023 on atb-devel-224 --- Summary of changes: source3/rpc_server/mdssvc/srv_mdssvc_nt.c | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c index c77e7185521..9a166244df5 100644 --- a/source3/rpc_server/mdssvc/srv_mdssvc
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 2a104556e84 s3/lib: Prevent use after free of messaging_ctdb_fde_ev structs from c2f8fde9f30 s3:test: Test winbind call depth trace https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 2a104556e8489b9fc3e2185a1fbbec7f4c8d8fea Author: Noel Power Date: Wed Jan 25 17:03:07 2023 + s3/lib: Prevent use after free of messaging_ctdb_fde_ev structs In a cluster setup samba-bgqd async callback cups_pcap_load_async can access messaging_ctdb_fde_ev associated with already destructed global_ctdb_ctx_destructor ==26053== Invalid read of size 8 ==26053==at 0x71692E1: messaging_ctdb_fde_ev_destructor (messages_ctdb.c:181) ==26053==by 0x40B2309: _tc_free_internal (talloc.c:1158) ==26053==by 0x40B3539: _tc_free_children_internal (talloc.c:1669) ==26053==by 0x40B24C4: _tc_free_internal (talloc.c:1184) ==26053==by 0x40B3539: _tc_free_children_internal (talloc.c:1669) ==26053==by 0x40B24C4: _tc_free_internal (talloc.c:1184) ==26053==by 0x40B2685: _talloc_free_internal (talloc.c:1248) ==26053==by 0x40B3963: _talloc_free (talloc.c:1792) ==26053==by 0x4056BCA: tevent_req_received (tevent_req.c:301) ==26053==by 0x405673D: tevent_req_destructor (tevent_req.c:135) ==26053==by 0x40B2309: _tc_free_internal (talloc.c:1158) ==26053==by 0x40B3539: _tc_free_children_internal (talloc.c:1669) ==26053==by 0x40B24C4: _tc_free_internal (talloc.c:1184) ==26053==by 0x40B2685: _talloc_free_internal (talloc.c:1248) ==26053==by 0x40B3963: _talloc_free (talloc.c:1792) ==26053==by 0x1384EF: cups_pcap_load_async (print_cups.c:507) ==26053==by 0x13894B: cups_cache_reload (print_cups.c:602) ==26053==by 0x1373AE: pcap_cache_reload (pcap.c:140) ==26053==by 0x1369D2: register_printing_bq_handlers (queue_process.c:323) ==26053==by 0x122AD6: main (samba-bgqd.c:316) ==26053== Address 0xed64d48 is 120 bytes inside a block of size 128 free'd ==26053==at 0x4C370EB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==26053==by 0x40B25E1: _tc_free_internal (talloc.c:1222) ==26053==by 0x40B2685: _talloc_free_internal (talloc.c:1248) ==26053==by 0x40B3963: _talloc_free (talloc.c:1792) ==26053==by 0x71691F6: messaging_ctdb_destroy (messages_ctdb.c:141) ==26053==by 0x7169C21: msg_ctdb_ref_destructor (messages_ctdb_ref.c:142) ==26053==by 0x40B2309: _tc_free_internal (talloc.c:1158) ==26053==by 0x40B3539: _tc_free_children_internal (talloc.c:1669) ==26053==by 0x40B24C4: _tc_free_internal (talloc.c:1184) ==26053==by 0x40B2685: _talloc_free_internal (talloc.c:1248) ==26053==by 0x40B3963: _talloc_free (talloc.c:1792) ==26053==by 0x4157380: messaging_reinit (messages.c:646) ==26053==by 0x416C01E: reinit_after_fork (util.c:488) ==26053==by 0x13844C: cups_pcap_load_async (print_cups.c:498) ==26053==by 0x13894B: cups_cache_reload (print_cups.c:602) ==26053==by 0x1373AE: pcap_cache_reload (pcap.c:140) ==26053==by 0x1369D2: register_printing_bq_handlers (queue_process.c:323) ==26053==by 0x122AD6: main (samba-bgqd.c:316) ==26053== Block was alloc'd at ==26053==at 0x4C346A4: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==26053==by 0x40B1989: __talloc_with_prefix (talloc.c:783) ==26053==by 0x40B1B23: __talloc (talloc.c:825) ==26053==by 0x40B1ECC: _talloc_named_const (talloc.c:982) ==26053==by 0x40B49C3: _talloc_zero (talloc.c:2421) ==26053==by 0x7168E68: messaging_ctdb_init (messages_ctdb.c:93) ==26053==by 0x716979D: messaging_ctdb_ref (messages_ctdb_ref.c:75) ==26053==by 0x415702A: messaging_init_internal (messages.c:563) ==26053==by 0x41572FD: messaging_init (messages.c:622) ==26053==by 0x4163ED3: global_messaging_context (global_contexts.c:62) ==26053==by 0x12273B: main (samba-bgqd.c:271) ==26053== Bug: https://bugzilla.samba.org/show_bug.cgi?id=15293 Signed-off-by: Noel Power Reviewed-by: Ralph Boehme Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Jan 26 16:03:49 UTC 2023 on atb-devel-224 --- Summary of changes: source3/lib/messages_ctdb.c | 19 +++ 1 file changed, 19 insertions(+) Changeset truncated at 500 lines: diff --git a/source3/lib/messages_ctdb.c b/source3/lib/messages_ctdb.c index 3e784bf7237..d55b53bf601 100644 --- a/source3/lib/messages_ctdb.c +++ b/source3/lib/messages_ctdb.c @@ -76,6 +76,21 @@ static int messaging_ctdb_recv( struct messaging_ctdb_context *global_ctdb_context; +static int
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f569f2c17f8 python/samba: use s3 param samba config parsing from 6ea1af287ee smbd: Simplify symlink_target_below_conn() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f569f2c17f87f551bcaa6c2fa5d6204107982c3b Author: Noel Power Date: Fri Nov 25 13:04:17 2022 + python/samba: use s3 param samba config parsing follup to commit: b4d7540bb4798e6801accf34a26fc0f2636bdd1f fix another instance to use s3 config parsing which is more forgiving (e.g. include directives that point to non existing files are ignored) Signed-off-by: Noel Power Reviewed-by: David Mulder Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Dec 6 10:38:56 UTC 2022 on sn-devel-184 --- Summary of changes: python/samba/gp/gpclass.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/python/samba/gp/gpclass.py b/python/samba/gp/gpclass.py index 39a34a75cf0..b5eb4a3515d 100644 --- a/python/samba/gp/gpclass.py +++ b/python/samba/gp/gpclass.py @@ -547,7 +547,8 @@ def rsop(lp, creds, store, gp_extensions, username, target): def parse_gpext_conf(smb_conf): -lp = LoadParm() +from samba.samba3 import param as s3param +lp = s3param.get_context() if smb_conf is not None: lp.load(smb_conf) else: -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 7cb50405515 nsswitch: Fix pam_set_data()/pam_get_data() to use pointers to a time_t, not try and embedd it directly. from 0fd7b13ebc3 s4:lib:tls: Don't negotiate session resumption with session tickets https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 7cb50405515298b75dcc512633fb3877045aabc6 Author: Jeremy Allison Date: Tue Nov 8 16:16:07 2022 -0800 nsswitch: Fix pam_set_data()/pam_get_data() to use pointers to a time_t, not try and embedd it directly. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15224 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Nov 16 15:09:45 UTC 2022 on sn-devel-184 --- Summary of changes: nsswitch/pam_winbind.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c index e7ae605b341..02a8aa8df98 100644 --- a/nsswitch/pam_winbind.c +++ b/nsswitch/pam_winbind.c @@ -3226,7 +3226,15 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags, */ if (flags & PAM_PRELIM_CHECK) { - time_t pwdlastset_prelim = 0; + time_t *pwdlastset_prelim = NULL; + + pwdlastset_prelim = talloc_array(NULL, time_t, 1); + if (pwdlastset_prelim == NULL) { + _pam_log(ctx, LOG_CRIT, +"password - out of memory"); + ret = PAM_BUF_ERR; + goto out; + } /* instruct user what is happening */ @@ -3258,7 +3266,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags, ret = winbind_auth_request(ctx, user, pass_old, NULL, NULL, 0, , NULL, - _prelim, NULL); + pwdlastset_prelim, NULL); if (ret != PAM_ACCT_EXPIRED && ret != PAM_AUTHTOK_EXPIRED && @@ -3269,7 +3277,8 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags, } pam_set_data(pamh, PAM_WINBIND_PWD_LAST_SET, -(void *)pwdlastset_prelim, NULL); +pwdlastset_prelim, +_pam_winbind_cleanup_func); ret = pam_set_item(pamh, PAM_OLDAUTHTOK, (const void *) pass_old); @@ -3280,7 +3289,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags, } } else if (flags & PAM_UPDATE_AUTHTOK) { - time_t pwdlastset_update = 0; + time_t *pwdlastset_update = NULL; /* * obtain the proposed password @@ -3343,8 +3352,9 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags, * By reaching here we have approved the passwords and must now * rebuild the password database file. */ - pam_get_data(pamh, PAM_WINBIND_PWD_LAST_SET, -(const void **) _update); + pam_get_data(pamh, +PAM_WINBIND_PWD_LAST_SET, +(const void **)_update); /* * if cached creds were enabled, make sure to set the @@ -3356,7 +3366,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags, } ret = winbind_chauthtok_request(ctx, user, pass_old, - pass_new, pwdlastset_update); + pass_new, *pwdlastset_update); if (ret != PAM_SUCCESS) { pass_old = pass_new = NULL; goto out; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 0a66c739532 s3-lib: restore truncating behavior of push_ascii_nstring() from 4f63c128078 gpo: Fix startup scripts to not fail w/out params https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 0a66c739532cbe9bad38deb78f76f48a676f7ffa Author: Philipp Gesang Date: Mon Oct 17 13:42:26 2022 +0200 s3-lib: restore truncating behavior of push_ascii_nstring() Some users of push_ascii_nstring() (notably name_to_unstring()) expect the output to be truncated if it would exceed the size of an nstring after conversion. However this broke in 2011 due to commit d546adeab5 ("Change convert_string_internal() and convert_string_error() to bool return"). This patch restores the old behavior. The issue can be observed in syslog after setting the ``workgroup`` to a 16+ characters long string which triggers a DEBUG() message: Oct 17 11:28:45 dev nmbd[11716]: name_to_nstring: workgroup name 0123456789ABCDEF0123456789ABCDEF is too long. Truncating to Signed-off-by: Philipp Gesang Reviewed-by: Noel Power Reviewed-by: Jeremy Allison Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Oct 25 16:25:40 UTC 2022 on sn-devel-184 --- Summary of changes: source3/lib/fstring.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/fstring.c b/source3/lib/fstring.c index 7ac50ece15b..3ed1db1f24c 100644 --- a/source3/lib/fstring.c +++ b/source3/lib/fstring.c @@ -41,8 +41,11 @@ size_t push_ascii_fstring(void *dest, const char *src) size_t push_ascii_nstring(void *dest, const char *src) { size_t converted_size = 0; - bool ret = convert_string_error(CH_UNIX, CH_DOS, src, -1, dest, sizeof(nstring), _size); - if (ret) { + bool ret; + + errno = 0; + ret = convert_string_error(CH_UNIX, CH_DOS, src, -1, dest, sizeof(nstring), _size); + if (ret || errno == E2BIG) { SCVAL(dest, sizeof(nstring)-1, 0); } else { SCVAL(dest, 0, 0); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 318da783e9d s3: smbtorture3: Add new SMB2-DFS-SHARE-NON-DFS-PATH test. via f3dc1a42f57 s3: torture: Fix test SMB2-DFS-PATHS to pass against Windows server 2022. from d89400b6201 samba-tool dsacl: Add additional unit test for delete subcommand https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 318da783e9df83550d86fcefcf89f55a77addcbe Author: Jeremy Allison Date: Tue Sep 27 10:37:41 2022 -0700 s3: smbtorture3: Add new SMB2-DFS-SHARE-NON-DFS-PATH test. Uses non-DFS names and DFS-names against a DFS share, shows that Windows looks correctly at the DFS flag when SMB2 requests are made on a DFS share. Passes against Windows 2022. Mark as knownfail for smbd. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Sep 28 19:34:29 UTC 2022 on sn-devel-184 commit f3dc1a42f578bec784d01b8caf6ff13e230116a2 Author: Jeremy Allison Date: Mon Sep 26 18:05:49 2022 -0700 s3: torture: Fix test SMB2-DFS-PATHS to pass against Windows server 2022. There is only one difference between Windows 2022 and Windows 2008. Opening an empty ("") DFS path succeeds in opening the share root on Windows 2008 but fails with NT_STATUS_INVALID_PARAMETER on Windows 2022. Allow the test to cope with both. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: selftest/knownfail.d/dfs_paths | 1 + source3/selftest/tests.py | 16 +++ source3/torture/proto.h| 1 + source3/torture/test_smb2.c| 247 +++-- source3/torture/torture.c | 4 + 5 files changed, 262 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/selftest/knownfail.d/dfs_paths b/selftest/knownfail.d/dfs_paths index 64ddfc9160a..127c0492f51 100644 --- a/selftest/knownfail.d/dfs_paths +++ b/selftest/knownfail.d/dfs_paths @@ -1,5 +1,6 @@ ^samba3.smbtorture_s3.smb2.SMB2-DFS-PATHS.smbtorture\(fileserver\) ^samba3.smbtorture_s3.smb2.SMB2-NON-DFS-SHARE.smbtorture\(fileserver\) +^samba3.smbtorture_s3.smb2.SMB2-DFS-SHARE-NON-DFS-PATH.smbtorture\(fileserver\) ^samba3.smbtorture_s3.smb1.SMB1-DFS-PATHS.smbtorture\(fileserver\) ^samba3.smbtorture_s3.smb1.SMB1-DFS-SEARCH-PATHS.smbtorture\(fileserver\) ^samba3.smbtorture_s3.smb1.SMB1-DFS-OPERATIONS.smbtorture\(fileserver\) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 68959ba0b90..04e47fa962f 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -264,6 +264,22 @@ plantestsuite("samba3.smbtorture_s3.smb2.SMB2-NON-DFS-SHARE", smbtorture3, "-mSMB2"]) +# +# SMB2-DFS-SHARE-NON-DFS-PATH needs to run against a special share msdfs-pathname-share +# This is an empty DFS share with no links, used merely to test +# incoming non-DFS pathnames and how they map to local paths. +# +plantestsuite("samba3.smbtorture_s3.smb2.SMB2-DFS-SHARE-NON-DFS-PATH", +"fileserver", +[os.path.join(samba3srcdir, + "script/tests/test_smbtorture_s3.sh"), +'SMB2-DFS-SHARE-NON-DFS-PATH', +'//$SERVER_IP/msdfs-pathname-share', +'$USERNAME', +'$PASSWORD', +smbtorture3, +"-mSMB2"]) + # # SMB1-DFS-PATHS needs to run against a special share msdfs-pathname-share # This is an empty DFS share with no links, used merely to test diff --git a/source3/torture/proto.h b/source3/torture/proto.h index 7093e8a7665..7b00da26181 100644 --- a/source3/torture/proto.h +++ b/source3/torture/proto.h @@ -122,6 +122,7 @@ bool run_smb2_quota1(int dummy); bool run_smb2_stream_acl(int dummy); bool run_smb2_dfs_paths(int dummy); bool run_smb2_non_dfs_share(int dummy); +bool run_smb2_dfs_share_non_dfs_path(int dummy); bool run_smb1_dfs_paths(int dummy); bool run_smb1_dfs_search_paths(int dummy); bool run_smb1_dfs_operations(int dummy); diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c index 234b39fedec..01664b14390 100644 --- a/source3/torture/test_smb2.c +++ b/source3/torture/test_smb2.c @@ -4059,15 +4059,41 @@ bool run_smb2_dfs_paths(int dummy) return false; } - /* An "" (empty) server name should open and match the share root. */ - ino_matched = smb2_inode_matches(cli, -dfs_root_share_name, -root_ino, -""); - if (!ino_matched) { - printf("%s:%d Failed to match ino number fo
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b600b0c8d96 s3: smbd: Fix memory leak in smbd_server_connection_terminate_done(). from f6b391e04a4 vfs_gpfs: Protect against timestamps before the Unix epoch https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b600b0c8d9690cb5eeded1e5925c8e667c11af04 Author: Jeremy Allison Date: Wed Sep 14 17:05:05 2022 -0700 s3: smbd: Fix memory leak in smbd_server_connection_terminate_done(). The function smbd_server_connection_terminate_done() does not free subreq which is allocated in smbXsrv_connection_shutdown_send, this can be a memory leakage if multi-channel is enabled. Suggested fix by haihua yang BUG: https://bugzilla.samba.org/show_bug.cgi?id=15174 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Sep 23 09:51:20 UTC 2022 on sn-devel-184 --- Summary of changes: source3/smbd/smb2_server.c | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index e8a91238baf..1cd5953f116 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1643,6 +1643,7 @@ static void smbd_server_connection_terminate_done(struct tevent_req *subreq) NTSTATUS status; status = smbXsrv_connection_shutdown_recv(subreq); + TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { exit_server("smbXsrv_connection_shutdown_recv failed"); } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c9a71e07ad1 s3: smbtorture: In run_smb1_dfs_paths() ensure we're actually reading and testing crtimes from the filesystem. via 15f464a3886 s3: smbtorture3: Fix invalid tests for file identity. from 66289ab678e s4:kdc: Set Kerberos debug class for all KDC files https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c9a71e07ad1b14f5dcd96ecce8e92f67a92b041f Author: Jeremy Allison Date: Wed Sep 7 15:15:38 2022 -0700 s3: smbtorture: In run_smb1_dfs_paths() ensure we're actually reading and testing crtimes from the filesystem. Ensures crtime of the root of the share and a newly created file crtime are different. Should help avoid mistakes like the error fixed by the previous commit. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Sep 12 16:21:23 UTC 2022 on sn-devel-184 commit 15f464a3886c40ce2459fc06c6c94506288f65f7 Author: Jeremy Allison Date: Wed Sep 7 15:13:45 2022 -0700 s3: smbtorture3: Fix invalid tests for file identity. The test SMB1-DFS-PATHS was using the file ino number to check for file identity, fetching it using cli_qfileinfo_basic(). This works for SMB2, but the info level used by this for SMB1 (SMB_QUERY_FILE_ALL_INFO) doesn't return the ino number, so all comparisons were succeeding as zero. Change to using crtime (create time) for identity comparison instead. This fix is mostly a rename of ino -> crtime, with some changes around the tests and printf on error, but it is easier to do in one go. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/torture/test_smb1_dfs.c | 238 ++-- 1 file changed, 131 insertions(+), 107 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/torture/test_smb1_dfs.c b/source3/torture/test_smb1_dfs.c index 136acde5b9d..1acea318e37 100644 --- a/source3/torture/test_smb1_dfs.c +++ b/source3/torture/test_smb1_dfs.c @@ -31,20 +31,21 @@ #include "libsmb/clirap.h" #include "async_smb.h" #include "../lib/util/tevent_ntstatus.h" +#include "lib/util/time_basic.h" extern fstring host, workgroup, share, password, username, myname; extern struct cli_credentials *torture_creds; /* - * Open an SMB1 file readonly and return the inode number. + * Open an SMB1 file readonly and return the create time. */ -static NTSTATUS get_smb1_inode(struct cli_state *cli, +static NTSTATUS get_smb1_crtime(struct cli_state *cli, const char *pathname, - uint64_t *ino_ret) + struct timespec *pcrtime) { NTSTATUS status; uint16_t fnum = 0; - SMB_INO_T ino = 0; + struct timespec crtime = {0}; /* * Open the file. @@ -76,7 +77,7 @@ static NTSTATUS get_smb1_inode(struct cli_state *cli, } /* -* Get the inode. Note - we can use +* Get the create time. Note - we can use * a higher-level cli_XXX function here * for SMB1 as cli_qfileinfo_basic() * doesn't use any pathnames, only fnums @@ -86,13 +87,13 @@ static NTSTATUS get_smb1_inode(struct cli_state *cli, fnum, NULL, /* attr */ NULL, /* size */ -NULL, /* create_time */ +, /* create_time */ NULL, /* access_time */ NULL, /* write_time */ NULL, /* change_time */ -); +NULL); if (NT_STATUS_IS_OK(status)) { - *ino_ret = (uint64_t)ino; + *pcrtime = crtime; } (void)smb1cli_close(cli->conn, @@ -106,36 +107,43 @@ static NTSTATUS get_smb1_inode(struct cli_state *cli, } /* - * Check an inode matches a given SMB1 path. + * Check a crtime matches a given SMB1 path. */ -static bool smb1_inode_matches(struct cli_state *cli, +static bool smb1_crtime_matches(struct cli_state *cli, const char *match_pathname, - uint64_t ino_tomatch, + struct timespec crtime_tomatch, const char *test_pathname) { - uint64_t test_ino = 0; + struct timespec test_crtime = { 0 }; NTSTATUS status; + bool equal = false; - status = get_smb1_i
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via cf5f7b14899 s3: smbd: Plumb close_type parameter through close_file_in_loop(), file_close_conn() via 7005a6354df s3: smbd: Add "enum file_close_type close_type" parameter to file_close_conn(). via 9203d17106c s3: smbd: Add "enum file_close_type close_type" parameter to close_cnum(). from e4371a4c3b8 release-script: Fix shellcheck errors https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit cf5f7b1489930f6d64c3e3512f116ccf286d4605 Author: Jeremy Allison Date: Wed Aug 17 11:43:47 2022 -0700 s3: smbd: Plumb close_type parameter through close_file_in_loop(), file_close_conn() Allows close_file_in_loop() to differentiate between SHUTDOWN_CLOSE (previously it only used this close type) and ERROR_CLOSE - called on error from smbXsrv_tcon_disconnect() in the error path. In that case we want to close the fd, but not run any delete-on-close actions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128 Signed-off-by: Jeremy Allison Reivewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Aug 18 14:10:18 UTC 2022 on sn-devel-184 commit 7005a6354df5522d9f665fb30052c458dfc93124 Author: Jeremy Allison Date: Wed Aug 17 11:39:36 2022 -0700 s3: smbd: Add "enum file_close_type close_type" parameter to file_close_conn(). Not yet used. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 9203d17106c0e55a30813ff1ed76869c7581a343 Author: Jeremy Allison Date: Wed Aug 17 11:35:29 2022 -0700 s3: smbd: Add "enum file_close_type close_type" parameter to close_cnum(). Not yet used, but needed so we can differentiate between SHUTDOWN_CLOSE and ERROR_CLOSE in smbXsrv_tcon_disconnect() if we fail to chdir. In that case we want to close the fd, but not run any delete-on-close actions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/smbd/files.c| 17 ++--- source3/smbd/proto.h| 6 -- source3/smbd/smb2_service.c | 6 -- source3/smbd/smbXsrv_tcon.c | 4 ++-- 4 files changed, 20 insertions(+), 13 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/files.c b/source3/smbd/files.c index a6c41f2b928..b494a8b789a 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -1258,7 +1258,8 @@ NTSTATUS parent_pathref(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } -static bool close_file_in_loop(struct files_struct *fsp) +static bool close_file_in_loop(struct files_struct *fsp, + enum file_close_type close_type) { if (fsp_is_alternate_stream(fsp)) { /* @@ -1276,7 +1277,7 @@ static bool close_file_in_loop(struct files_struct *fsp) fsp->base_fsp->stream_fsp = NULL; fsp->base_fsp = NULL; - close_file_free(NULL, , SHUTDOWN_CLOSE); + close_file_free(NULL, , close_type); return NULL; } @@ -1300,7 +1301,7 @@ static bool close_file_in_loop(struct files_struct *fsp) return false; } - close_file_free(NULL, , SHUTDOWN_CLOSE); + close_file_free(NULL, , close_type); return true; } @@ -1310,6 +1311,7 @@ static bool close_file_in_loop(struct files_struct *fsp) struct file_close_conn_state { struct connection_struct *conn; + enum file_close_type close_type; bool fsp_left_behind; }; @@ -1331,7 +1333,7 @@ static struct files_struct *file_close_conn_fn( fsp->op->global->durable = false; } - did_close = close_file_in_loop(fsp); + did_close = close_file_in_loop(fsp, state->close_type); if (!did_close) { state->fsp_left_behind = true; } @@ -1339,9 +1341,10 @@ static struct files_struct *file_close_conn_fn( return NULL; } -void file_close_conn(connection_struct *conn) +void file_close_conn(connection_struct *conn, enum file_close_type close_type) { - struct file_close_conn_state state = { .conn = conn }; + struct file_close_conn_state state = { .conn = conn, + .close_type = close_type }; files_forall(conn->sconn, file_close_conn_fn, ); @@ -1427,7 +1430,7 @@ static struct files_struct *file_close_user_fn( return NULL; } - did_close = close_file_in_loop(fsp); + did_close = close_file_in_loop(fsp, SHUTDOWN_CLOSE); if (!did_close) { state->
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f92bacbe216 s3/smbd: Use after free when iterating smbd_server_connection->connections via 0bdfb5a5e60 s3/smbd: Use after free when iterating smbd_server_connection->connections from 123f1c07c41 s3:utils remove documentation of -l as alias for --long https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f92bacbe216d2d74ea3ccf3fe0df5c1cc9860996 Author: Jeremy Allison Date: Fri Jul 22 16:28:03 2022 +0100 s3/smbd: Use after free when iterating smbd_server_connection->connections Change conn_free() to just use a destructor. We now catch any other places where we may have forgetten to call conn_free() - it's implicit on talloc_free(conn). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128 Based on code from Noel Power . Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Aug 17 09:54:06 UTC 2022 on sn-devel-184 commit 0bdfb5a5e60df214c088df0782c4a1bcc2a4944a Author: Jeremy Allison Date: Tue Aug 16 13:51:27 2022 -0700 s3/smbd: Use after free when iterating smbd_server_connection->connections In SMB2 smbd_smb2_tree_connect() we create a new conn struct inside make_connection_smb2() then move the ownership to tcon using: tcon->compat = talloc_move(tcon, _conn); so the lifetime of tcon->compat is tied directly to tcon. Inside smbXsrv_tcon_disconnect() we have: 908 ok = chdir_current_service(tcon->compat); 909 if (!ok) { 910 status = NT_STATUS_INTERNAL_ERROR; 911 DEBUG(0, ("smbXsrv_tcon_disconnect(0x%08x, '%s'): " 912 "chdir_current_service() failed: %s\n", 913 tcon->global->tcon_global_id, 914 tcon->global->share_name, 915 nt_errstr(status))); 916 tcon->compat = NULL; 917 return status; 918 } 919 920 close_cnum(tcon->compat, vuid); 921 tcon->compat = NULL; If chdir_current_service(tcon->compat) fails, we return status without ever having called close_cnum(tcon->compat, vuid), leaving the conn pointer left in the linked list sconn->connections. The caller frees tcon and (by ownership) tcon->compat, still leaving the freed tcon->compat pointer on the sconn->connections linked list. When deadtime_fn() fires and walks the sconn->connections list it indirects this freed pointer. We must call close_cnum() on error also. Valgrind trace from Noel Power is: ==6432== Invalid read of size 8 ==6432==at 0x52CED3A: conn_lastused_update (conn_idle.c:38) ==6432==by 0x52CEDB1: conn_idle_all (conn_idle.c:54) ==6432==by 0x5329971: deadtime_fn (smb2_process.c:1566) ==6432==by 0x5DA2339: smbd_idle_event_handler (util_event.c:45) ==6432==by 0x685F2F8: tevent_common_invoke_timer_handler (tevent_timed.c:376) ==6432== Address 0x19074b88 is 232 bytes inside a block of size 328 free'd ==6432==at 0x4C3451B: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==6432==by 0x5B38521: _tc_free_internal (talloc.c:1222) ==6432==by 0x5B39463: _tc_free_children_internal (talloc.c:1669) ==6432==by 0x5B38404: _tc_free_internal (talloc.c:1184) ==6432==by 0x5B39463: _tc_free_children_internal (talloc.c:1669) ==6432==by 0x5B38404: _tc_free_internal (talloc.c:1184) ==6432==by 0x5B39463: _tc_free_children_internal (talloc.c:1669) ==6432==by 0x5B38404: _tc_free_internal (talloc.c:1184) ==6432==by 0x5B39463: _tc_free_children_internal (talloc.c:1669) ==6432==by 0x5B38404: _tc_free_internal (talloc.c:1184) ==6432==by 0x5B385C5: _talloc_free_internal (talloc.c:1248) ==6432==by 0x5B3988D: _talloc_free (talloc.c:1792) ==6432==by 0x5349B22: smbd_smb2_flush_send_queue (smb2_server.c:4828) ==6432== Block was alloc'd at ==6432==at 0x4C332EF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==6432==by 0x5B378D9: __talloc_with_prefix (talloc.c:783) ==6432==by 0x5B37A73: __talloc (talloc.c:825) ==6432==by 0x5B37E0C: _talloc_named_const (talloc.c:982) ==6432==by 0x5B3A8ED: _talloc_zero (talloc.c:2421) ==6432==by 0x539873A: conn_new (conn.c:70) ==6432==by 0x532D692: make_connection_smb2 (smb2_service.c:909) ==6432==by 0x5352B5E: smbd_smb2_tree_
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 61c6a00f550 mdssvc: check if the user closed the query before trying to read the HTTP response from Elasticsearch via c9ecd33ad7d mdssvc: fold two if blocks into one via ac13935a585 mdssvc: don't trigger http reconnect if a search was cancelled via 1150d121b7f mdssvc: fix check if search connection state is gone via 9b0e61ff75d mdssvc: reapply default search destructor when marking a search non-pending via 9b56c7030f8 mdssvc: prevent a crash when pending search finishes after the client closed the search connection via 2fc2c7d4b0b mdssvc: move calling mds_es_search_set_pending() to mds_es_next_search_trigger() via 5b750d6b330 mdssvc: consolidate calls of mds_es_search_unset_pending() via c0d46796d43 mdssvc: update a comment via 3254622a307 mdssvc: fix a comment from 93b6db3328c s3: smbd: Convert smb_file_rename_information() to use filename_convert_dirfsp(). https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 61c6a00f550a6ffc8fe704e15bc44134befc40c8 Author: Ralph Boehme Date: Fri Nov 19 13:24:50 2021 +0100 mdssvc: check if the user closed the query before trying to read the HTTP response from Elasticsearch BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Aug 3 14:00:36 UTC 2022 on sn-devel-184 commit c9ecd33ad7db1ebf0b45c84b3909da7f5d719856 Author: Ralph Boehme Date: Fri Nov 19 16:50:44 2021 +0100 mdssvc: fold two if blocks into one No change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit ac13935a58518a3af34fd49701846b8dbe72b7b0 Author: Ralph Boehme Date: Fri Nov 19 13:21:31 2021 +0100 mdssvc: don't trigger http reconnect if a search was cancelled Calling tevent_req_error() triggers a HTTP reconnect in mds_es_search_done() as mds_es_search_recv() returns the error so we call mds_es_reconnect_on_error(). slq (which is s->slq) or s->mds_es_ctx will be NULL if the user closed a search or disconnected a share with an active mdssvc IPC pipe, no need to trigger a HTTP reconnect for those cases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit 1150d121b7f6588de1aa37eac810c19dbfc07a71 Author: Ralph Boehme Date: Fri Nov 19 13:11:20 2021 +0100 mdssvc: fix check if search connection state is gone This was dead code: before this patchset noone set s->mds_es_ctx->mds_ctx to NULL. A previous commit changed that so now the mds_es_ctx destructor sets s->mds_es_ctx to NULL if a search "s" was currently in-flight. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit 9b0e61ff75db0d875da81ada6d2333b01985d264 Author: Ralph Boehme Date: Thu Nov 18 16:51:36 2021 +0100 mdssvc: reapply default search destructor when marking a search non-pending This is needed to ensure searches that are scheduled more then once to the Elasticsarch server (because the first run didn't return all results) get removed from the list of searches in case the user closes the query. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit 9b56c7030f86f24a5b21f2a972a641afb556f7ab Author: Ralph Boehme Date: Fri Nov 19 13:29:54 2021 +0100 mdssvc: prevent a crash when pending search finishes after the client closed the search connection When a search is in-flight and currently being processed against the Elasticsearch server, we set s->pending. In the destructor of "s" we check "pending" and reject deallocation of the object. One instance where "s" is requested to be deallocated is when the client closes the top-level per-share search connection. This will implicitly close all searches associated with the mds_ctx from mds_ctx_destructor_cb(): while (mds_ctx->query_list != NULL) { /* * slq destructor removes element from list. * Don't use TALLOC_FREE()! */ talloc_free(mds_ctx->query_list); } So when this happens the Elasticsearch backend query object stays around, alongside with any active tevent_req request and a tevent_req timer set with tevent_req_set_endtime() in mds_es_search_send(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915 RN: mdssvc crashes when searches are pe
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 23e6e50c0f8 mdssvc: return all-zero policy handle if spotlight is disabled via 8e997bd6e92 CI: fix check for correct mdsvc resonse when connecting to a share with Spotlight disabled via 72468166b25 mdssvc: convert mds_init_ctx() to return NTSTATUS via d54144356a8 mdssvc: fix indentation from 11d3d2aeac5 rpc_server3: Initialize mangle_fns in classic and spoolss https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 23e6e50c0f82b997dea4a67069f65252045514c0 Author: Ralph Boehme Date: Wed May 25 17:37:22 2022 +0200 mdssvc: return all-zero policy handle if spotlight is disabled A Mac SMB server returns an all zero handle and an empty path if Spotlight is disabled on a share. We must return the exact same error return in order to trigger client-side searching. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086 pcap: https://www.samba.org/~slow/pcaps/mac-bigsur-smbserver-spotlight-disabled.pcapng.gz Signed-off-by: Ralph Boehme Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jul 12 15:42:52 UTC 2022 on sn-devel-184 commit 8e997bd6e9250499fd8e569d708edc29e304a0e8 Author: Ralph Boehme Date: Tue Jun 7 09:52:53 2022 +0200 CI: fix check for correct mdsvc resonse when connecting to a share with Spotlight disabled A Mac SMB server returns an all zero handle and an empty path if Spotlight is disabled on a share. We must return the exact same error return in order to trigger client-side searching. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086 pcap: https://www.samba.org/~slow/pcaps/mac-bigsur-smbserver-spotlight-disabled.pcapng.gz Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit 72468166b250de26747071cbbf3613c016ebfd42 Author: Ralph Boehme Date: Wed May 25 17:26:29 2022 +0200 mdssvc: convert mds_init_ctx() to return NTSTATUS No change in behavour. In preperation for returning a special error to signal the caller that spotlight is disabled for a share. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit d54144356a87d58b88359bb871a0e955278da1e1 Author: Ralph Boehme Date: Wed May 25 17:23:53 2022 +0200 mdssvc: fix indentation Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power --- Summary of changes: source3/rpc_server/mdssvc/mdssvc.c| 52 +++ source3/rpc_server/mdssvc/mdssvc.h| 15 - source3/rpc_server/mdssvc/srv_mdssvc_nt.c | 28 +++-- source3/selftest/tests.py | 2 +- source4/torture/rpc/mdssvc.c | 17 +- 5 files changed, 67 insertions(+), 47 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c index 21212cb5c03..01713722126 100644 --- a/source3/rpc_server/mdssvc/mdssvc.c +++ b/source3/rpc_server/mdssvc/mdssvc.c @@ -1572,13 +1572,14 @@ static int mds_ctx_destructor_cb(struct mds_ctx *mds_ctx) * This ends up being called for every tcon, because the client does a * RPC bind for every tcon, so this is acually a per tcon context. **/ -struct mds_ctx *mds_init_ctx(TALLOC_CTX *mem_ctx, -struct tevent_context *ev, -struct messaging_context *msg_ctx, -struct auth_session_info *session_info, -int snum, -const char *sharename, -const char *path) +NTSTATUS mds_init_ctx(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct messaging_context *msg_ctx, + struct auth_session_info *session_info, + int snum, + const char *sharename, + const char *path, + struct mds_ctx **_mds_ctx) { const struct loadparm_substitution *lp_sub = loadparm_s3_global_substitution(); @@ -1590,21 +1591,22 @@ struct mds_ctx *mds_init_ctx(TALLOC_CTX *mem_ctx, smb_iconv_t iconv_hnd = (smb_iconv_t)-1; NTSTATUS status; + if (!lp_spotlight(snum)) { + return NT_STATUS_WRONG_VOLUME; + } + mds_ctx = talloc_zero(mem_ctx, struct mds_ctx); if (mds_ctx == NULL) { - return NULL; + return NT_STATUS_NO_MEMORY; } talloc_set_destructor(mds_ctx, mds_ctx_destructor_cb); mds_ctx->mdssvc_ctx = mdssvc_init(ev); if (mds_ctx->mdss
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 96a649efd8d s3: libads: Fix coverity false positive. from 17f8ec6f57a s4:mitkdc: Always set SDB_F_FOR_{TGS,AS}_REQ flag for DAL >= 9 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 96a649efd8d4da05c99a67e33a2354d4f2a4ced7 Author: Jeremy Allison Date: Fri Jul 1 08:49:42 2022 -0700 s3: libads: Fix coverity false positive. dn is always returned as NULL on error in ads_build_path(), but coverity can't see that. Easy change to quieten it. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Jul 4 16:42:28 UTC 2022 on sn-devel-184 --- Summary of changes: source3/libads/ads_struct.c | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 90634effc58..97f84d124d0 100644 --- a/source3/libads/ads_struct.c +++ b/source3/libads/ads_struct.c @@ -106,6 +106,7 @@ ADS_STATUS ads_build_dn(const char *realm, TALLOC_CTX *mem_ctx, char **_dn) status = ads_build_path(realm, ".", "dc=", 0, ); if (!ADS_ERR_OK(status)) { + SAFE_FREE(dn); return status; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 808a7b8b76d s3: VFS: streams_xattr: Add the same accommodation to streams_xattr_unlinkat() as used in streams_xattr_renameat(). via 238b2cbb8f3 s3: tests: Add test that shows smbd crashes using vfs_fruit with fruit:resource = stream on deleting a file. from 81fdcf95ae9 s3/client: fix dfs deltree, resolve dfs path https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 808a7b8b76dbcaac1db0508fd410d0bcf702af7a Author: Jeremy Allison Date: Fri Jun 17 17:51:35 2022 -0700 s3: VFS: streams_xattr: Add the same accommodation to streams_xattr_unlinkat() as used in streams_xattr_renameat(). vfs_fruit passes a synthetic filename here where smb_fname->fsp==NULL when configured to use "fruit:resource = stream" so we need to use synthetic_pathref() to get an fsp on the smb_fname->base_name in order to call SMB_VFS_FREMOVEXATTR(). This is the same change we already use in streams_xattr_renameat() and streams_xattr_stat(), the other pathname operations we implement here. Remove knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15099 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Jun 20 14:24:20 UTC 2022 on sn-devel-184 commit 238b2cbb8f352375c448d86b462f13752640e16b Author: Jeremy Allison Date: Fri Jun 17 17:49:43 2022 -0700 s3: tests: Add test that shows smbd crashes using vfs_fruit with fruit:resource = stream on deleting a file. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15099 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: selftest/target/Samba3.pm | 9 + source3/modules/vfs_streams_xattr.c| 25 +++-- source3/script/tests/test_fruit_resource_stream.sh | 41 ++ source3/selftest/tests.py | 4 +++ 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100755 source3/script/tests/test_fruit_resource_stream.sh Changeset truncated at 500 lines: diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 798796bc21f..db8c55602da 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -2567,6 +2567,9 @@ sub provision($$) my $local_symlinks_shrdir="$shrdir/local_symlinks"; push(@dirs,$local_symlinks_shrdir); + my $fruit_resource_stream_shrdir="$shrdir/fruit_resource_stream"; + push(@dirs,$fruit_resource_stream_shrdir); + # this gets autocreated by winbindd my $wbsockdir="$prefix_abs/wbsock"; @@ -3127,6 +3130,12 @@ sub provision($$) fruit:metadata = stream fruit:zero_file_id=yes +[fruit_resource_stream] + path = $fruit_resource_stream_shrdir + vfs objects = fruit streams_xattr acl_xattr xattr_tdb + fruit:resource = stream + fruit:metadata = stream + [badname-tmp] path = $badnames_shrdir guest ok = yes diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 324490354b0..3e39770bb37 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -479,6 +479,8 @@ static int streams_xattr_unlinkat(vfs_handle_struct *handle, NTSTATUS status; int ret = -1; char *xattr_name = NULL; + struct smb_filename *pathref = NULL; + struct files_struct *fsp = smb_fname->fsp; if (!is_named_stream(smb_fname)) { return SMB_VFS_NEXT_UNLINKAT(handle, @@ -497,10 +499,26 @@ static int streams_xattr_unlinkat(vfs_handle_struct *handle, goto fail; } - SMB_ASSERT(smb_fname->fsp != NULL); - SMB_ASSERT(fsp_is_alternate_stream(smb_fname->fsp)); + if (fsp == NULL) { + status = synthetic_pathref(talloc_tos(), + handle->conn->cwd_fsp, + smb_fname->base_name, + NULL, + NULL, + smb_fname->twrp, + smb_fname->flags, + ); + if (!NT_STATUS_IS_OK(status)) { + errno = ENOENT; + goto fail; + } + fsp = pathref->fsp; + } else { + SMB_ASSERT(fsp_is_alternate_stream(smb_fname->fsp)); + fsp = fsp->base_fsp; + } - ret = SMB_VFS_FREMOVEXATTR(smb_fname->fsp->base_fsp, xattr_name); + ret =
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 56e17981712 s3/client: Restore '-E' handling via 5b6493043fc s3/script/tests: Test smbclient -E redirects output to stderr from a26f535dedc s3:libads: Clear previous CLDAP ping flags when reusing the ADS_STRUCT https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 56e179817123b40c3646476563d345d8f97efff9 Author: Noel Power Date: Mon May 23 17:23:41 2022 +0100 s3/client: Restore '-E' handling Sometimes we really do need to redirect output to stderr e.g. when using the tar command to output the archive to stdout we don't want debug or cmdline status messages straying into stdout. was removed with commit: e4474ac0a540c56548b4d15e38f2e234455e19b6 remove known fail for the test BUG: https://bugzilla.samba.org/show_bug.cgi?id=15075 Signed-off-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue May 24 10:29:27 UTC 2022 on sn-devel-184 commit 5b6493043fc90a2bed5aaedad3b4511621d0b9fd Author: Noel Power Date: Mon May 23 20:11:13 2022 +0100 s3/script/tests: Test smbclient -E redirects output to stderr Add new test to ensure smbclient is writing to stderr (with '-E') Add knownfail for this test (will be removed when issue is fixed in later commit) BUG: https://bugzilla.samba.org/show_bug.cgi?id=15075 Signed-off-by: Noel Power --- Summary of changes: source3/client/client.c | 5 source3/script/tests/test_smbclient_s3.sh | 45 +++ 2 files changed, 50 insertions(+) Changeset truncated at 500 lines: diff --git a/source3/client/client.c b/source3/client/client.c index 15e32d379f0..9f9954b7e96 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -6552,6 +6552,11 @@ int main(int argc,char *argv[]) print_sockaddr(dest_ss_str, sizeof(dest_ss_str), _ss); } break; + case 'E': + setup_logging("smbclient", DEBUG_STDERR ); + display_set_stderr(); + break; + case 'L': query_host = talloc_strdup(frame, poptGetOptArg(pc)); if (!query_host) { diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 3da37e699e6..fc608bdfc9b 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -2043,6 +2043,47 @@ EOF return 0 } +test_smbclient_minus_e_stderr() +{ +cmd='$SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -c ls' +eval echo "$cmd" +out=`eval $cmd` +if [ $? != 0 ] ; then + echo "$out" + echo "command failed" + return 1 +fi + +# test smbclient 'ls' command output went to stdout +echo "$out" | grep "blocks available" >/dev/null 2>&1 +if [ $? != 0 ] ; then + # didn't get output to stdout + echo "expected output was NOT output to stdout" + return 1 +fi + +# this time execute ls but redirect stdout alone to /dev/null +cmd='$SMBCLIENT -E "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -c "ls" 2>&1 > /dev/null' +eval echo "$cmd" +out=`eval $cmd` +if [ $? != 0 ] ; then + echo "$out" + echo "command failed" + return 1 +fi + +# test smbclient 'ls' command output went to stderr +echo "$out" | grep "blocks available" >/dev/null 2>&1 +if [ $? != 0 ] ; then + # didn't get output to stderr + echo "expected output was NOT output to stderr" + return 1 +fi + +return 0 + +} + # # LOGDIR_PREFIX=test_smbclient_s3 @@ -2068,6 +2109,10 @@ testit "noninteractive smbclient -l does not prompt" \ test_noninteractive_no_prompt -l $LOGDIR || \ failed=`expr $failed + 1` +testit "smbclient output goes to stderr when -E is passed" \ +test_smbclient_minus_e_stderr || \ +failed=`expr $failed + 1` + testit "interactive smbclient prompts on stdout" \ test_interactive_prompt_stdout || \ failed=`expr $failed + 1` -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6dc463d3e2e s3:auth: Fix user_in_list() for UNIX groups via af8747a28bd s3:tests Test "username map" for UNIX groups via 0feeb6d58a6 selftest: Add to "username.map" mapping for jackthemappergroup via 26e4268d6e3 selftest: Create groups "jackthemappergroup" and "jacknomappergroup" via 1b014618222 selftest: Create users "jackthemapper" and "jacknomapper" from a27bbfc8a96 streams_depot: Simplify stream_dir() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6dc463d3e2eb229df1c4f620cfcaf22ac71738d4 Author: Pavel Filipenský Date: Fri Mar 25 11:11:50 2022 +0100 s3:auth: Fix user_in_list() for UNIX groups BUG: https://bugzilla.samba.org/show_bug.cgi?id=15041 Signed-off-by: Pavel Filipenský Reviewed-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Apr 7 09:49:44 UTC 2022 on sn-devel-184 commit af8747a28bd62937a01fa4648f404bd0b09a44c0 Author: Pavel Filipenský Date: Tue Apr 5 14:04:52 2022 +0200 s3:tests Test "username map" for UNIX groups BUG: https://bugzilla.samba.org/show_bug.cgi?id=15041 Signed-off-by: Pavel Filipenský Reviewed-by: Jeremy Allison Reviewed-by: Noel Power commit 0feeb6d58a6d6b1949faa842473053af4562c979 Author: Pavel Filipenský Date: Tue Apr 5 08:31:41 2022 +0200 selftest: Add to "username.map" mapping for jackthemappergroup BUG: https://bugzilla.samba.org/show_bug.cgi?id=15041 Only for environment ad_member_idmap_nss. * !jacknompapper = \@jackthemappergroup jackthemaper from group jackthemappergroup is mapped to jacknompapper * !root = jacknomappergroup since there is no '@' or '+' prefix, it is not an UNIX group mapping Signed-off-by: Pavel Filipenský Reviewed-by: Jeremy Allison Reviewed-by: Noel Power commit 26e4268d6e3bde74520e36f3ca3cc9d979292d1d Author: Pavel Filipenský Date: Tue Apr 5 08:30:23 2022 +0200 selftest: Create groups "jackthemappergroup" and "jacknomappergroup" BUG: https://bugzilla.samba.org/show_bug.cgi?id=15041 Signed-off-by: Pavel Filipenský Reviewed-by: Jeremy Allison Reviewed-by: Noel Power commit 1b0146182224fe01ed70815364656a626038685a Author: Pavel Filipenský Date: Fri Apr 1 15:56:30 2022 +0200 selftest: Create users "jackthemapper" and "jacknomapper" BUG: https://bugzilla.samba.org/show_bug.cgi?id=15041 Signed-off-by: Pavel Filipenský Reviewed-by: Noel Power Reviewed-by: Jeremy Allison --- Summary of changes: selftest/target/Samba3.pm| 22 -- source3/auth/user_util.c | 12 +++- source3/script/tests/test_usernamemap.sh | 28 source3/selftest/tests.py| 2 ++ 4 files changed, 57 insertions(+), 7 deletions(-) create mode 100755 source3/script/tests/test_usernamemap.sh Changeset truncated at 500 lines: diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 068d3b1f06e..4a86a77bb95 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1569,8 +1569,10 @@ sub setup_ad_member_idmap_nss my $extra_member_options = " # bob:x:65521:65531:localbob gecos:/:/bin/false # jane:x:65520:65531:localjane gecos:/:/bin/false + # jackthemapper:x:65519:65531:localjackthemaper gecos:/:/bin/false + # jacknomapper:x:65518:65531:localjacknomaper gecos:/:/bin/false idmap config $dcvars->{DOMAIN} : backend = nss - idmap config $dcvars->{DOMAIN} : range = 65520-65521 + idmap config $dcvars->{DOMAIN} : range = 65518-65521 # Support SMB1 so that we can use posix_whoami(). client min protocol = CORE @@ -1591,6 +1593,8 @@ sub setup_ad_member_idmap_nss open(USERMAP, ">$prefix/lib/username.map") or die("Unable to open $prefix/lib/username.map"); print USERMAP " +!jacknomapper = \@jackthemappergroup +!root = jacknomappergroup root = $dcvars->{DOMAIN}/root bob = $dcvars->{DOMAIN}/bob "; @@ -2663,6 +2667,8 @@ sub provision($$) my ($gid_nobody, $gid_nogroup, $gid_root, $gid_domusers, $gid_domadmins); my ($gid_userdup, $gid_everyone); my ($gid_force_user); + my ($gid_jackthemapper); + my ($gid_jacknomapper); my ($uid_user1); my ($uid_user2); my ($uid_gooduser); @@ -2670,6 +2676,8 @@ sub provision($$) my ($uid_slashuser); my ($uid_localbob); my ($uid_localjane); + my ($
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b9b82f3611c s3: libsmb: Call cli_dfs_target_check() from cli_smb2_rename_send(). via 4473aea926f s3: libsmb: Call cli_dfs_target_check() from cli_cifs_rename_send(). via dd0317f6ecb s3: libsmb: Call cli_dfs_target_check() from cli_smb1_rename_send(). via cf3e5724422 s3: libsmb: Call cli_dfs_target_check() from cli_ntrename_internal_send(). via 4bdbe3c2fc0 s3: libsmb: Call cli_dfs_target_check() from cli_smb2_hardlink_send(). via 2abba0ea109 s3: libsmb: Add cli_dfs_target_check() function. via 44cc9fb0e01 s3: tests: Add a new test test_msdfs_rename() that does simple renames on MSDFS root shares. via d7deb876053 s3: tests: Add a new test test_msdfs_hardlink() that does simple hardlinks on MSDFS root shares. from 0c6554aa0d6 bootstrap: Fix CentOS8 runner https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b9b82f3611c56e837e9189f5275ae9a78e647262 Author: Jeremy Allison Date: Thu Feb 3 15:59:51 2022 -0800 s3: libsmb: Call cli_dfs_target_check() from cli_smb2_rename_send(). Strips off any DFS prefix from the target if passed in. Remove knownfail selftest/knownfail.d/msdfs-rename. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Feb 4 12:02:36 UTC 2022 on sn-devel-184 commit 4473aea926fe4ddd23a6e0913009bb1a0a1eaa90 Author: Jeremy Allison Date: Thu Feb 3 15:56:51 2022 -0800 s3: libsmb: Call cli_dfs_target_check() from cli_cifs_rename_send(). Strips off any DFS prefix from the target if passed in. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit dd0317f6ecb572a80893405daa83e079dbcdf113 Author: Jeremy Allison Date: Thu Feb 3 15:54:55 2022 -0800 s3: libsmb: Call cli_dfs_target_check() from cli_smb1_rename_send(). Strips off any DFS prefix from the target if passed in. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit cf3e5724422d8becd045542be196dfea6ac9ec2b Author: Jeremy Allison Date: Thu Feb 3 14:54:26 2022 -0800 s3: libsmb: Call cli_dfs_target_check() from cli_ntrename_internal_send(). Currently we don't pass MSDFS names as targets here, but a caller may erroneously do this later, and for non-DFS names this is a no-op. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 4bdbe3c2fc0c35635474ae526896b28f55142aca Author: Jeremy Allison Date: Thu Feb 3 14:51:13 2022 -0800 s3: libsmb: Call cli_dfs_target_check() from cli_smb2_hardlink_send(). Currently we don't pass MSDFS names as targets here, but a caller may erroneously do this later, and for non-DFS names this is a no-op. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 2abba0ea109d7a3a0b0cb4a7030293f70c2d9d8a Author: Jeremy Allison Date: Thu Feb 3 11:15:30 2022 -0800 s3: libsmb: Add cli_dfs_target_check() function. Strips any DFS prefix from a target name that will be passed to an SMB1/2/3 rename or hardlink call. Returns a pointer into the original target name after the prefix. Not yet used. If the incoming filename is *NOT* a DFS prefix, the original filename is returned unchanged. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 44cc9fb0e01b3635804f41e03f9b20afc3bfe36c Author: Jeremy Allison Date: Thu Feb 3 14:21:26 2022 -0800 s3: tests: Add a new test test_msdfs_rename() that does simple renames on MSDFS root shares. We fail this on SMB2 for a subtle reason. Our client code called from smbclient only sets the SMB2_HDR_FLAG_DFS flag in the outgoing packet on the SMB2_CREATE call, and SMB2 rename does the following operations: SMB2_CREATE(src_path) // We set SMB2_HDR_FLAG_DFS here for a MSDFS share. SMB2_SETINFO: SMB2_FILE_RENAME_INFO(dst_path). // We don't set SMB2_HDR_FLAG_DFS However, from smbclient, dst_path is a MSDFS path but we don't set the flag, so even though the rename code inside smbd will cope with a MSDFS path (as used in the SMB1 SMBmv call) it fails as the correct flag isn't set. Add knownfail selftest/knownfail.d/msdfs-rename. Note we need to add the new test to "selftest/knownfail.d/smb1-tests" as test_smbclient_s3.sh is run against the (ad_member|nt4_member) environments first using NT1 (SMB1
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 0eecfddd071 s3/rpc_server: install elasticsearch_mappings.json from 36c861e25b1 printing/bgqd: Disable systemd notifications https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 0eecfddd071ea54844c56516dd7adc761be03c27 Author: Ralph Boehme Date: Thu Jan 27 12:06:55 2022 +0100 s3/rpc_server: install elasticsearch_mappings.json This was removed accidentally remvoed by a7c65958a15149918415b7456d6f20ee8c9669d2 because the original code only installed the json file if the mdssvc was built as module: if bld.SAMBA3_IS_ENABLED_MODULE('rpc_mdssvc_module'): bld.INSTALL_FILES(bld.env.SAMBA_DATADIR, 'mdssvc/elasticsearch_mappings.json') Installing the json file should just depend on Elasticsearch support being enabled, regardless of the removed module support. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14961 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Jan 28 10:22:31 UTC 2022 on sn-devel-184 --- Summary of changes: source3/rpc_server/wscript_build | 3 +++ 1 file changed, 3 insertions(+) Changeset truncated at 500 lines: diff --git a/source3/rpc_server/wscript_build b/source3/rpc_server/wscript_build index 04ff3424d47..83ceca2a45c 100644 --- a/source3/rpc_server/wscript_build +++ b/source3/rpc_server/wscript_build @@ -250,6 +250,9 @@ if bld.env.spotlight_backend_es: ''' rpc_mdssvc_deps += ' http jansson' +bld.INSTALL_FILES(bld.env.SAMBA_DATADIR, + 'mdssvc/elasticsearch_mappings.json') + bld.SAMBA3_BINARY('rpcd_mdssvc', source='rpcd_mdssvc.c ' + rpc_mdssvc_sources, deps=''' -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ea9dc21a230 s3: smbd: Remove now redundent lock_flav parameter from smbd_do_unlocking(). via 07c74582c0f s3: smbd: Remove lock_flav argument from smbd_smb1_brl_finish_by_lock(). via 8ec30dade11 s3: smbd: Remove lock_flav argument from internal function smbd_smb1_do_locks_check() via b03e0da5288 s3: smbd: Remove lock_flav argument from smbd_smb1_do_locks_send(). via c1d59934894 s3: smbd: In smbd_smb1_do_locks_send() move access of lock_flav until after we know we have locks in the array. via 4a567652422 s3: smbd: Remove lock_flav parameter from smbd_do_locks_try(). via 85e131b54ba s3: smbd: Move implicit call to lp_posix_cifsu_locktype() out of init_strict_lock_struct(). via 9a0212800cb s3: smbd: Add "enum brl_flavour" to struct smbd_lock_element. from 099c62a654d s3: smbclient: In do_host_query(), if we need SMB1, ensure we select NT1 as the client max protocol" before continuing. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ea9dc21a2308b9d8ad51d3205327e9e91ade9d84 Author: Jeremy Allison Date: Tue Nov 16 17:04:02 2021 -0800 s3: smbd: Remove now redundent lock_flav parameter from smbd_do_unlocking(). We already stored this in struct smbd_lock_element. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Jan 6 16:03:28 UTC 2022 on sn-devel-184 commit 07c74582c0f9fd74d00a667879787cdde1de3fb3 Author: Jeremy Allison Date: Tue Nov 16 16:56:02 2021 -0800 s3: smbd: Remove lock_flav argument from smbd_smb1_brl_finish_by_lock(). We lookup the lock array from the state stored in the passed-in req and all the locks in an array are always the same flavour, so this isn't needed. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 8ec30dade11c85b6f6b55a3ab564167f79ba3b0f Author: Jeremy Allison Date: Tue Nov 16 16:48:58 2021 -0800 s3: smbd: Remove lock_flav argument from internal function smbd_smb1_do_locks_check() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit b03e0da5288667933d69b8a162534cdec8bc9b25 Author: Jeremy Allison Date: Tue Nov 16 16:41:09 2021 -0800 s3: smbd: Remove lock_flav argument from smbd_smb1_do_locks_send(). And also inside struct smbd_smb1_do_locks_state. All calls to this always (a) have one or more locks of the same type. (the setup for smbd_smb1_do_locks_send() ensures there is always at least one lock) and (b) always set locks[0].lock_flav correctly before calling. lock_flav is thus a redundent argument. Removing it means we can never drift out of sync with the lock_flav element in the passed in locks array. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit c1d5993489472ac857f83729c901004f26866d6f Author: Jeremy Allison Date: Tue Nov 16 16:15:54 2021 -0800 s3: smbd: In smbd_smb1_do_locks_send() move access of lock_flav until after we know we have locks in the array. When we remove the lock_flav parameter this will need to look into the array itself. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 4a567652422f8fcf507fa8e5ec7300d7014268a0 Author: Jeremy Allison Date: Tue Nov 16 15:06:59 2021 -0800 s3: smbd: Remove lock_flav parameter from smbd_do_locks_try(). This is now contained in the struct smbd_lock_element for each lock. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 85e131b54ba91f349316d9d637b4344d1a642bc5 Author: Jeremy Allison Date: Tue Nov 16 15:00:03 2021 -0800 s3: smbd: Move implicit call to lp_posix_cifsu_locktype() out of init_strict_lock_struct(). Make it explicit. When we add POSIX handles to SMB2 we will only look at the handle type. lp_posix_cifsu_locktype() already does this, but hidden inside init_strict_lock_struct() makes it hard to see. No logic change. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 9a0212800cbc51e51e069334f1d5f3aa0e239086 Author: Jeremy Allison Date: Tue Nov 16 14:26:44 2021 -0800 s3: smbd: Add "enum brl_flavour" to struct smbd_lock_element. Initialized correctly but not yet used. Will allow 'brl_flavour' to be removed from lock calls. This will allow SMB2 POSIX handles to call with POSIX_LOCK flavour instead of always using WINDOWS_LOCK (as now). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/include/locking.h | 1 + source3/locking/locking.c | 1 + source3/locking/proto.h | 1 + source3/modules/vfs_btrfs.c
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 099c62a654d s3: smbclient: In do_host_query(), if we need SMB1, ensure we select NT1 as the client max protocol" before continuing. via 0d9d1546a7b s3: selftest: Add two tests that show we try and send an SMB1 request over an SMB2 connection to list servers if "-mSMB3" is selected. from 42cf3f4f007 lib: Fix a typo https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 099c62a654da2623653218c771dd8fabdc7cc091 Author: Jeremy Allison Date: Mon Jan 3 16:52:25 2022 -0800 s3: smbclient: In do_host_query(), if we need SMB1, ensure we select NT1 as the client max protocol" before continuing. Remove knownfail: selftest/knownfail.d/list_servers BUG: https://bugzilla.samba.org/show_bug.cgi?id=14939 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Jan 6 11:50:32 UTC 2022 on sn-devel-184 commit 0d9d1546a7bad6e0fac58e146a75e4eb1ce78c11 Author: Jeremy Allison Date: Mon Jan 3 16:48:17 2022 -0800 s3: selftest: Add two tests that show we try and send an SMB1 request over an SMB2 connection to list servers if "-mSMB3" is selected. Add knownfail: knownfail.d/list_servers BUG: https://bugzilla.samba.org/show_bug.cgi?id=14939 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/client/client.c| 1 + .../script/tests/test_smbclient_list_servers.sh| 45 ++ source3/selftest/tests.py | 18 + 3 files changed, 64 insertions(+) create mode 100755 source3/script/tests/test_smbclient_list_servers.sh Changeset truncated at 500 lines: diff --git a/source3/client/client.c b/source3/client/client.c index 7ea9f4f96aa..690f9deaec9 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -6224,6 +6224,7 @@ static int do_host_query(const char *query_host) cli_shutdown(cli); d_printf("Reconnecting with SMB1 for workgroup listing.\n"); + lp_set_cmdline("client max protocol", "NT1"); status = cli_cm_open(talloc_tos(), NULL, query_host, "IPC$", diff --git a/source3/script/tests/test_smbclient_list_servers.sh b/source3/script/tests/test_smbclient_list_servers.sh new file mode 100755 index 000..884a5a25b9a --- /dev/null +++ b/source3/script/tests/test_smbclient_list_servers.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Ensure we don't get an error smb1cli_req_writev_submit: called for dialect[SMB3_11] +# when listing servers via -L. +# BUG: https://bugzilla.samba.org/show_bug.cgi?id=14939 + +if [ $# -lt 5 ]; then +cat <
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b5e0f33e829 pytest/docs: better spelling of set_smbconf_arbitrary via b674c57a182 pytest/docs: set_smbconf_arbitrary_opposite() needs param_type via 5bbf105937c pytest/dns_aging: remove duplicate tests via 524ca3c6d23 pytest/dns_aging: use correct variable names via b5e2651f1ca py/dnsserver: add a missing exception variable via 3c18bb6c77d py/dnsserver: add missing imports from 1926335839a third_party/update: forget pep8 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b5e0f33e8296d6312efadd8a78d752b788d66f54 Author: Douglas Bagnall Date: Fri Nov 19 16:16:30 2021 +1300 pytest/docs: better spelling of set_smbconf_arbitrary Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Nov 22 11:18:09 UTC 2021 on sn-devel-184 commit b674c57a1829365f50bfdf846ca609d4ac205e52 Author: Douglas Bagnall Date: Fri Nov 19 16:15:50 2021 +1300 pytest/docs: set_smbconf_arbitrary_opposite() needs param_type also, we fixed the name ("arbitrary", not "arbitary"). Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 5bbf105937cd94a09abe550297aa0d366aa839e1 Author: Douglas Bagnall Date: Fri Nov 19 16:13:39 2021 +1300 pytest/dns_aging: remove duplicate tests Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 524ca3c6d23323a67fad36e39f5e05f893c44a80 Author: Douglas Bagnall Date: Fri Nov 19 16:12:43 2021 +1300 pytest/dns_aging: use correct variable names Signed-off-by: Douglas Bagnall commit b5e2651f1ca99a8a654f60767a40f9228413437b Author: Douglas Bagnall Date: Fri Nov 19 16:21:08 2021 +1300 py/dnsserver: add a missing exception variable Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 3c18bb6c77d33b000489c6b4bd1dd87b81f2162f Author: Douglas Bagnall Date: Fri Nov 19 16:11:14 2021 +1300 py/dnsserver: add missing imports Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: python/samba/dnsserver.py | 3 ++- python/samba/tests/dns_aging.py | 16 ++-- python/samba/tests/docs.py | 10 ++ 3 files changed, 10 insertions(+), 19 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/dnsserver.py b/python/samba/dnsserver.py index 0170dc23efb..86a2a6ceaf2 100644 --- a/python/samba/dnsserver.py +++ b/python/samba/dnsserver.py @@ -19,6 +19,7 @@ import shlex import socket from samba.dcerpc import dnsserver, dnsp +from samba import WERRORError, werror # Note: these are not quite the same as similar looking classes in # provision/sambadns.py -- those ones are based on @@ -296,7 +297,7 @@ def flag_from_string(rec_type): rtype = rec_type.upper() try: return getattr(dnsp, 'DNS_TYPE_' + rtype) -except AttributeError: +except AttributeError as e: raise DNSParseError('Unknown type of DNS record %s' % rec_type) from e diff --git a/python/samba/tests/dns_aging.py b/python/samba/tests/dns_aging.py index 2e7369bed00..4818451f789 100644 --- a/python/samba/tests/dns_aging.py +++ b/python/samba/tests/dns_aging.py @@ -2146,7 +2146,7 @@ class TestDNSAging(DNSTest): # D is scavengeable atime = self.dns_update_record(A, A).dwTimeStamp btime = self.ldap_update_record(B, B, dwTimeStamp=now-20).dwTimeStamp -btime = self.ldap_update_record(C, C, dwTimeStamp=now-40).dwTimeStamp +ctime = self.ldap_update_record(C, C, dwTimeStamp=now-40).dwTimeStamp dtime = self.ldap_update_record(D, D, dwTimeStamp=now-60).dwTimeStamp self.assert_soon_after(atime, now) self.assert_timestamps_equal(btime, now-20) @@ -2158,7 +2158,7 @@ class TestDNSAging(DNSTest): # D should be gone (tombstoned) r = self.get_unique_txt_record(D, D) self.assertIsNone(r) -r = dns_query(self, D, qtype=dns.DNS_QTYPE_TXT) +r = self.dns_query(D, qtype=dns.DNS_QTYPE_TXT) self.assertEqual(r.ancount, 0) recs = self.ldap_get_records(D) self.assertEqual(len(recs), 1) @@ -2552,12 +2552,6 @@ class TestDNSAging(DNSTest): def test_dns_delete_simple_112_113_days_no_aging(self): self._test_dns_delete_simple(112, 113, False) -def test_dns_delete_simple_112_113_days_aging(self): -self._test_dns_delete_simple(112, 113, True) - -def test_dns_delete_simple_112_113_days_no_aging(self): -self._test_dns_delete_simple(112, 113, False) - def test_dns_delete_simple_0_113_days_aging(self): # 1e9 hours ago evaluates to 0, i.e static self._test_dns_delete_simple(1e9, 113, True) @@ -2601
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1926335839a third_party/update: forget pep8 via 2c3596e7214 pytest/source_chars: forget thirdparty/pep8 test file via e94e649bbb4 third_party: remove pep8 from cdc0268c198 cmdline: Make -P work in clustered mode https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1926335839a83795a8594fe0b3a2a298bdf366ac Author: Douglas Bagnall Date: Fri Nov 19 15:33:09 2021 +1300 third_party/update: forget pep8 Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Nov 19 13:25:16 UTC 2021 on sn-devel-184 commit 2c3596e72144fb1b356de860ccfef1ea1f39fd9d Author: Douglas Bagnall Date: Fri Nov 19 15:28:48 2021 +1300 pytest/source_chars: forget thirdparty/pep8 test file Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit e94e649bbb474920c681c644e9a53e5f09147982 Author: Douglas Bagnall Date: Fri Nov 19 15:18:23 2021 +1300 third_party: remove pep8 This was a *partial* copy of the python linting tool that has been known as 'pycodestyle' since 2017. I say partial copy, because it does not seem to contain the pep8 binary itself, just some documentation and tests. It has not been changed since it was added in 2015. It is GOOD that people run python linters, but this doesn't help them in the slightest. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: python/samba/tests/source_chars.py | 2 - third_party/pep8/.gitignore | 7 - third_party/pep8/.travis.yml | 25 -- third_party/pep8/CHANGES.txt | 651 --- third_party/pep8/LICENSE | 24 -- third_party/pep8/MANIFEST.in | 9 - third_party/pep8/Makefile| 13 - third_party/pep8/README.rst | 91 - third_party/pep8/docs/Makefile | 153 third_party/pep8/docs/advanced.rst | 77 third_party/pep8/docs/api.rst| 88 - third_party/pep8/docs/conf.py| 251 third_party/pep8/docs/developer.rst | 96 - third_party/pep8/docs/index.rst | 69 third_party/pep8/docs/intro.rst | 435 - third_party/pep8/docs/make.bat | 190 - third_party/pep8/setup.cfg | 7 - third_party/pep8/setup.py| 56 --- third_party/pep8/testsuite/E10.py| 41 -- third_party/pep8/testsuite/E11.py| 36 -- third_party/pep8/testsuite/E12.py| 376 -- third_party/pep8/testsuite/E12not.py | 644 -- third_party/pep8/testsuite/E20.py| 55 --- third_party/pep8/testsuite/E21.py| 14 - third_party/pep8/testsuite/E22.py| 157 third_party/pep8/testsuite/E23.py| 15 - third_party/pep8/testsuite/E24.py| 13 - third_party/pep8/testsuite/E25.py| 36 -- third_party/pep8/testsuite/E26.py| 59 --- third_party/pep8/testsuite/E27.py| 30 -- third_party/pep8/testsuite/E30.py| 90 - third_party/pep8/testsuite/E30not.py | 134 --- third_party/pep8/testsuite/E40.py| 38 -- third_party/pep8/testsuite/E50.py| 118 -- third_party/pep8/testsuite/E70.py| 20 - third_party/pep8/testsuite/E71.py| 73 third_party/pep8/testsuite/E72.py| 51 --- third_party/pep8/testsuite/E73.py| 18 - third_party/pep8/testsuite/E90.py| 26 -- third_party/pep8/testsuite/W19.py| 145 --- third_party/pep8/testsuite/W29.py| 21 - third_party/pep8/testsuite/W39.py| 18 - third_party/pep8/testsuite/W60.py| 15 - third_party/pep8/testsuite/__init__.py | 0 third_party/pep8/testsuite/latin-1.py| 6 - third_party/pep8/testsuite/noqa.py | 15 - third_party/pep8/testsuite/python3.py| 6 - third_party/pep8/testsuite/support.py| 197 -- third_party/pep8/testsuite/test_all.py | 63 --- third_party/pep8/testsuite/test_api.py | 389 -- third_party/pep8/testsuite/test_shell.py | 189 - third_party/pep8/testsuite/test_util.py | 23 -- third_party/pep8/testsuite/utf-8-bom.py | 6 - third_party/pep8/testsuite/utf-8.py | 52 --- third_party/pep8/tox.ini | 15 - third_party/update.sh| 5 - 56 files changed, 5453 deletions(-) delete mode 100644 third_party/pep8/.gitignore delete mode 100644 third_party/pep8/.travis.yml delete mode 100644 third_party/pep8/CHANGES.txt delete mode 100644 third_party/pep8/LICENSE delete mode 100644 third_party/pep8/MANIFEST.in delete
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 71cef2fa1dd docs: document new Spotlight Elasticsearch options via 8e3372eceab mdssvc: add options to allow ignoring attribute and type mapping errors via c6743237891 mdssvc: prepare for ignore attribute and type mapping errors via 232146775bb selftest: add a test ignored spotlight/elasticsearch mapping failures from 8ab0238abd1 .gitlab-ci: Avoid duplicate CI on all merge requests https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 71cef2fa1ddbe05d29e7ce571a35888ef4663b22 Author: Ralph Boehme Date: Wed Oct 13 19:16:10 2021 +0200 docs: document new Spotlight Elasticsearch options elasticsearch:ignore unknown attribute = yes | no (default: no) elasticsearch:ignore unknown type = yes | no (default: no) Signed-off-by: Ralph Boehme Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Oct 14 10:20:27 UTC 2021 on sn-devel-184 commit 8e3372eceab1bc7ad8ac813b12d654c979e20769 Author: Ralph Boehme Date: Sat Oct 9 18:51:14 2021 +0200 mdssvc: add options to allow ignoring attribute and type mapping errors This adds two options that are used by the Spotlight query parser to optionally ignore unknown attributes or types in a query. elasticsearch:ignore unknown attribute = yes | no (default: no) elasticsearch:ignore unknown type = yes | no (default: no) Example Spotlight query with unknown attributes and type: kMDItemContentType=="public.calendar-event"||kMDItemSubject=="Kalender*"cdw|| kMDItemTitle=="Kalender*"cdw||kMDItemTopic=="Kalender*"cdw|| kMDItemTextContent=="Kalender*"cd||*=="Kalender*"cdw|| kMDItemTextContent=="Kalender*"cdw The unknown attributes are "kMDItemTopic" and "kMDItemSubject". The unkown type is "public.calendar-event". Currently the parser will outright fail to parse the query and the search will enter an error state. To give users some control over the mapping the above options can be used to tell the parser to simply ignore such unknown attributes and types. (meta.title:Kalender* OR content:Kalender* OR Kalender* OR content:Kalender*) Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit c67432378910691456f1deec3d5a8a73a6080887 Author: Ralph Boehme Date: Sat Oct 9 18:50:02 2021 +0200 mdssvc: prepare for ignore attribute and type mapping errors Lower the debug levels to debug from error. No change in behaviour. Signed-off-by: Ralph Boehme Reviewed-by: Noel Power commit 232146775bb00769a3c208441ad0fa28bfe7f42f Author: Ralph Boehme Date: Sat Oct 9 16:44:25 2021 +0200 selftest: add a test ignored spotlight/elasticsearch mapping failures Signed-off-by: Ralph Boehme Reviewed-by: Noel Power --- Summary of changes: .../misc/elasticsearchignoreunknownattribute.xml | 19 .../misc/elasticsearchignoreunknowntype.xml| 19 selftest/tests.py | 6 ++ source3/rpc_server/mdssvc/es_mapping.c | 2 +- source3/rpc_server/mdssvc/es_parser.y | 102 - source3/rpc_server/mdssvc/test_mdsparser_es.c | 54 +++ 6 files changed, 180 insertions(+), 22 deletions(-) create mode 100644 docs-xml/smbdotconf/misc/elasticsearchignoreunknownattribute.xml create mode 100644 docs-xml/smbdotconf/misc/elasticsearchignoreunknowntype.xml Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/misc/elasticsearchignoreunknownattribute.xml b/docs-xml/smbdotconf/misc/elasticsearchignoreunknownattribute.xml new file mode 100644 index 000..86368d30e58 --- /dev/null +++ b/docs-xml/smbdotconf/misc/elasticsearchignoreunknownattribute.xml @@ -0,0 +1,19 @@ +http://www.samba.org/samba/DTD/samba-doc;> + + + Ignore unknown Spotlight attributes in search queries. An example query + using the unsupported attribute + kMDItemTopic would be + kMDItemTopic==hotstuff. By + default any query using such a type would completely fail. By enabling + this option, if the type match is a subexpression of a larger expression, + then this subexpression is just ignored. + + + + no + yes + diff --git a/docs-xml/smbdotconf/misc/elasticsearchignoreunknowntype.xml b/docs-xml/smbdotconf/misc/elasticsearchignoreunknowntype.xml new file mode 100644 index 000..ca1f873adac --- /dev/null +++ b/docs-xml/smbdotconf/misc/elasticsearchignoreunknowntype.xml @@ -0,0 +1,19 @@ +http://www.samba.org/samba/DTD/samba-doc;> + + + Ignore unknown S
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 72b4fe93f15 s3: smbd: Ensure all returns from OpenDir() correctly set errno. from 649f544ab2c s3: VFS: streams_depot: Allow "streams directory" outside of share path to work again. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 72b4fe93f15e414ca3e7d7f0e77a5f0aae90556a Author: Jeremy Allison Date: Thu Aug 19 15:43:52 2021 -0700 s3: smbd: Ensure all returns from OpenDir() correctly set errno. Complex code paths inside open_internal_dirfsp() can return an NTSTATUS, but trample on the matching errno. We need to make sure if open_internal_dirfsp() fails, errno matches the NTSTATUS return. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14805 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Aug 20 09:56:49 UTC 2021 on sn-devel-184 --- Summary of changes: source3/smbd/dir.c | 2 ++ 1 file changed, 2 insertions(+) Changeset truncated at 500 lines: diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 4c807c3f85c..174f07b1159 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1474,6 +1474,8 @@ struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, O_RDONLY, ); if (!NT_STATUS_IS_OK(status)) { + /* Ensure we return the actual error from status in errno. */ + errno = map_errno_from_nt_status(status); return NULL; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d1ca3137809 s3: VFS: Update status of SMB_VFS_CHFLAGS via f3008db0c3f VFS: Remove SMB_VFS_CHFLAGS, not used anymore via ceb1403d04b VFS: unityed_media: Remove SMB_VFS_CHFLAGS via 8f243bb8c24 VFS: snapper: Remove SMB_VFS_CHFLAGS via 3d71465b46a VFS: shadow_copy2: Remove SMB_VFS_CHFLAGS via 205532f38a4 VFS: media_harmony: Remove SMB_VFS_CHFLAGS via a7eb3a7125e VFS: glusterfs Remove SMB_VFS_CHFLAGS via f60235f2bdc VFS: catia: Remove SMB_VFS_CHFLAGS via 11e1deaf91f VFS: ceph_snapshot Remove SMB_VFS_CHFLAGS via 2e24d9c5343 VFS: ceph: Remove SMB_VFS_CHFLAGS via 4b98fc6914d s3/smbd: smb_set_file_unix_info2: SMB_VFS_CHFLAGS -> SMB_VFS_FCHFLAGS via a346647edd2 VFS: snapper: Add SMB_VFS_FCHFLAGS implementation via d8e5ffa94e9 VFS: shadow_copy2: Add SMB_VFS_FCHFLAGS implementation via a6c45ba03e8 VFS: glusterfs: Add SMB_VFS_FCHFLAGS implementation via afad1ce9485 VFS: ceph_snapshots: Add SMB_VFS_FCHFLAGS implementation via 69ef500b8d5 VFS: ceph: Add SMB_VFS_FCHFLAGS implementation via 9ca41e197f3 VFS: Add initial implemenataion for SMB_VFS_FCHFLAGS from 5f70396e62d idl: secrets_domain_info1_change is not a recursive structure https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d1ca3137809800fe1014a06aa3912241d540d1b2 Author: Noel Power Date: Thu Jun 17 10:03:05 2021 +0100 s3: VFS: Update status of SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jun 29 09:10:00 UTC 2021 on sn-devel-184 commit f3008db0c3f3ae277ee38dcedea094b78cc53487 Author: Noel Power Date: Fri Jun 11 16:58:24 2021 +0100 VFS: Remove SMB_VFS_CHFLAGS, not used anymore Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit ceb1403d04ba67d0ea92c58a05a457f1bd47acf4 Author: Noel Power Date: Fri Jun 11 16:34:01 2021 +0100 VFS: unityed_media: Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 8f243bb8c248fe48f4fd2cd87366fddb7f3e06c3 Author: Noel Power Date: Fri Jun 11 16:33:30 2021 +0100 VFS: snapper: Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 3d71465b46ac3bec1db46347a5d9945df96b46a8 Author: Noel Power Date: Fri Jun 11 16:33:02 2021 +0100 VFS: shadow_copy2: Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 205532f38a468fad72f5a153baece9fab4ac4f09 Author: Noel Power Date: Fri Jun 11 16:32:41 2021 +0100 VFS: media_harmony: Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit a7eb3a7125e3b56c6400af09ec01c882dcad70dd Author: Noel Power Date: Fri Jun 11 16:32:04 2021 +0100 VFS: glusterfs Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit f60235f2bdc673464d62bad262837b8c6bc828b3 Author: Noel Power Date: Fri Jun 11 16:30:04 2021 +0100 VFS: catia: Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 11e1deaf91fd56dc4d3f18fe42e653de379eda5f Author: Noel Power Date: Fri Jun 11 16:31:38 2021 +0100 VFS: ceph_snapshot Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 2e24d9c53438935f0544b8f05335f0142b225c58 Author: Noel Power Date: Fri Jun 11 16:31:13 2021 +0100 VFS: ceph: Remove SMB_VFS_CHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 4b98fc6914d3b292d958a5aa55614949aa069f52 Author: Noel Power Date: Fri Jun 11 16:23:12 2021 +0100 s3/smbd: smb_set_file_unix_info2: SMB_VFS_CHFLAGS -> SMB_VFS_FCHFLAGS Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit a346647edd2e0b9b81dc75067b584a92fcd1eb56 Author: Noel Power Date: Fri Jun 11 15:46:56 2021 +0100 VFS: snapper: Add SMB_VFS_FCHFLAGS implementation Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit d8e5ffa94e9caf0a43864be6eadd36da4dec680e Author: Noel Power Date: Fri Jun 11 15:46:30 2021 +0100 VFS: shadow_copy2: Add SMB_VFS_FCHFLAGS implementation Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit a6c45ba03e897bd9c97fa718ff29f0986214207e Author: Noel Power Date: Fri Jun 11 15:46:07 2021 +0100 VFS: glusterfs: Add SMB_VFS_FCHFLAGS implementation Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit afad1ce94855f11621e4bea02395ff6067a14eea Author: Noel Power Date: Fri Jun 11 15:45:51 2021 +0100 VFS: ceph_snapshots: Add SMB_VFS_FCHFLAGS implementation Signed-off-by: Noel Power Reviewed-by: Jeremy Allison
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1139f96cc78 s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_set_file(). No longer used. via 246a1966102 s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_get_file(). No longer used. from 0fe2ae66089 lib:ldb-samba: Use debug level defines https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1139f96cc788baefe25068788c33e9ca6b860e64 Author: Jeremy Allison Date: Tue Jun 22 10:23:22 2021 -0700 s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_set_file(). No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Jun 23 09:56:00 UTC 2021 on sn-devel-184 commit 246a19661026ddfbcebeba7b291a779f6bac9a55 Author: Jeremy Allison Date: Tue Jun 22 10:22:16 2021 -0700 s3: VFS: posixacl_xattr: Remove posixacl_xattr_acl_get_file(). No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/modules/posixacl_xattr.c | 107 --- source3/modules/posixacl_xattr.h | 10 2 files changed, 117 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/modules/posixacl_xattr.c b/source3/modules/posixacl_xattr.c index ef0521eda34..365cdc79973 100644 --- a/source3/modules/posixacl_xattr.c +++ b/source3/modules/posixacl_xattr.c @@ -335,78 +335,6 @@ static int smb_acl_to_posixacl_xattr(SMB_ACL_T theacl, char *buf, size_t len) return size; } -SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - SMB_ACL_TYPE_T type, - TALLOC_CTX *mem_ctx) -{ - int ret; - int size; - char *buf; - const char *name; - - if (type == SMB_ACL_TYPE_ACCESS) { - name = ACL_EA_ACCESS; - } else if (type == SMB_ACL_TYPE_DEFAULT) { - name = ACL_EA_DEFAULT; - } else { - errno = EINVAL; - return NULL; - } - - size = ACL_EA_SIZE(20); - buf = alloca(size); - if (!buf) { - return NULL; - } - - ret = SMB_VFS_GETXATTR(handle->conn, smb_fname, - name, buf, size); - if (ret < 0 && errno == ERANGE) { - size = SMB_VFS_GETXATTR(handle->conn, smb_fname, - name, NULL, 0); - if (size > 0) { - buf = alloca(size); - if (!buf) { - return NULL; - } - ret = SMB_VFS_GETXATTR(handle->conn, - smb_fname, name, - buf, size); - } - } - - if (ret > 0) { - return posixacl_xattr_to_smb_acl(buf, ret, mem_ctx); - } - if (ret == 0 || errno == ENOATTR) { - mode_t mode = 0; - TALLOC_CTX *frame = talloc_stackframe(); - struct smb_filename *smb_fname_tmp = - cp_smb_filename_nostream(frame, smb_fname); - if (smb_fname_tmp == NULL) { - errno = ENOMEM; - ret = -1; - } else { - ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp); - if (ret == 0) { - mode = smb_fname_tmp->st.st_ex_mode; - } - } - TALLOC_FREE(frame); - if (ret == 0) { - if (type == SMB_ACL_TYPE_ACCESS) { - return mode_to_smb_acl(mode, mem_ctx); - } - if (S_ISDIR(mode)) { - return sys_acl_init(mem_ctx); - } - errno = EACCES; - } - } - return NULL; -} - SMB_ACL_T posixacl_xattr_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_TYPE_T type, @@ -454,41 +382,6 @@ SMB_ACL_T posixacl_xattr_acl_get_fd(vfs_handle_struct *handle, return NULL; } -int posixacl_xattr_acl_set_file(vfs_handle_struct *handle, - const struct smb_filename *smb_fname, - SMB_ACL_TYPE_T type, - SMB_ACL_T theacl) -{ - const char *name; - char *buf; - ssize_t size; - int ret; - - size = smb_acl_to_posixacl_xattr(theacl, NULL, 0); - buf
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fb665462b17 s3: VFS: Update status of SMB_VFS_RENAMEAT. via 5059d37f1f5 s3: smbd: Make SMB_VFS_RENAMEAT() a relative call. via ab01a36d4a3 s3: VFS: streams_xattr: Use real dirfsp for SMB_VFS_RENAMEAT() via e5274ecdb60 s3: VFS: streams_depot: Use real dirfsp for SMB_VFS_RENAMEAT() via 395cee80e91 s3: VFS: unityed_media: Use real dirfsp for SMB_VFS_RENAMEAT() via a2f3c4f5ed2 s3: VFS: time_audit: Use real dirfsp for SMB_VFS_RENAMEAT() via c04d6e8464f s3: VFS: syncops: Use real dirfsp for SMB_VFS_RENAMEAT() via 11ec689c1d8 s3: VFS: virusfilter: Use real dirfsp for SMB_VFS_RENAMEAT() via 2c5ead7fd61 s3: VFS: media_harmony: Use real dirfsp for SMB_VFS_RENAMEAT() via 69f38589044 s3: VFS: glusterfs: Use real dirfsp for SMB_VFS_RENAMEAT() via f02f55e84d5 s3: VFS: full_audit.c: Use real dirfsp for SMB_VFS_RENAMEAT() via 770357f666f s3: VFS: extd_audit: Use real dirfsp for SMB_VFS_RENAMEAT() via 5235ffea593 s3: VFS: ceph: Use real dirfsp for SMB_VFS_RENAMEAT() via a9832db6ac0 s3: VFS: cap: Use real dirfsp for SMB_VFS_RENAMEAT() via 7785da8dde5 s3: VFS: audit: Use real dirfsp for SMB_VFS_RENAMEAT() via 5c18f074be9 s3: VFS: crossrename. Use real dirfsp for SMB_VFS_RENAMEAT() via bb8e66cd2dc s3: smbd: Make copy_internals() public. vfs_crossrename() will be changed to use this. via abc210943d8 s3: VFS: syncops. Do early return in syncops_renameat(). via d76abb32239 s3: VFS: syncops. Do early return in syncops_linkat() via 5da0d75dd47 s3: VFS: syncops: Do early returns in SYNCOPS_NEXT_SMB_FNAME() macro. via fbeefe3b7e6 s3: VFS: syncops: Remove direct system calls and use OpenDir()/smb_vfs_fsync_sync()/TALLOC_FREE() to sync a directory. via 6d1972b79ea s3: VFS: syncops: Add 'connection_struct *conn' to syncops_sync_directory(). via 1687df4d07a s3: VFS: Add 'connection_struct *conn' parameter to syncops_two_names(). via 8848ebf504f s3: VFS: syncops. Add 'connection_struct *conn' to syncops_smb_fname(). via ec0c271071e s3: lib: In adouble_path(), if the parent directory name is ".", don't prepend "./" to the outgoing filename. via c04df97ee52 s3: VFS: Cleanup. Remove SMB_VFS_FSYNC() macro. from 002ef728bb0 torture: Fix build on freebsd, missing deps on cmdline https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fb665462b1739f3bda8b9f02f34144e856d70eed Author: Jeremy Allison Date: Fri Jun 18 11:43:30 2021 -0700 s3: VFS: Update status of SMB_VFS_RENAMEAT. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jun 22 14:34:06 UTC 2021 on sn-devel-184 commit 5059d37f1f58e648c7fbf11fa1bb6f0bd3ae65d7 Author: Jeremy Allison Date: Fri Jun 18 11:41:22 2021 -0700 s3: smbd: Make SMB_VFS_RENAMEAT() a relative call. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit ab01a36d4a34a5b2112392b45d679e958aab5faf Author: Jeremy Allison Date: Thu Jun 17 21:36:33 2021 -0700 s3: VFS: streams_xattr: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit e5274ecdb60cff9ec947a9a196891ef089bbeadd Author: Jeremy Allison Date: Thu Jun 17 21:05:00 2021 -0700 s3: VFS: streams_depot: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 395cee80e916e39f65022b7a06557339e7bc7c7c Author: Jeremy Allison Date: Thu Jun 17 20:58:37 2021 -0700 s3: VFS: unityed_media: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit a2f3c4f5ed2d16e34e034a92b5fabb769ad46c04 Author: Jeremy Allison Date: Thu Jun 17 20:52:19 2021 -0700 s3: VFS: time_audit: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit c04d6e8464f6db634e74de720433794e9ae19e8d Author: Jeremy Allison Date: Thu Jun 17 12:28:30 2021 -0700 s3: VFS: syncops: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 11ec689c1d8ade1fbe42117d51c6893bdedcbd7a Author: Noel Power Date: Thu Jun 17 11:29:17 2021 -0700 s3: VFS: virusfilter: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 2c5ead7fd615843c3957751d8d1acedbdc1ec9e1 Author: Jeremy Allison Date: Thu Jun 17 10:47:42 2021 -0700 s3: VFS: media_harmony: Use real dirfsp for SMB_VFS_RENAMEAT() Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 69f3858904456f0e8490eab9df87385373973e64 Author: Jeremy Allison Date:
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 263c95aee38 s3: smbd: Fix smbd crash on dangling symlink with posix connection calling several non-posix info levels. via ac10058d7f6 s3: torture: Add POSIX-SYMLINK-SETPATHINFO regression test. from 620b9914435 mdssvc: avoid direct filesystem access, use the VFS https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 263c95aee38c9198ad9a30c4d960d72f46b7c27a Author: Jeremy Allison Date: Tue Jun 15 15:42:33 2021 -0700 s3: smbd: Fix smbd crash on dangling symlink with posix connection calling several non-posix info levels. Tidy up fsp == NULL checks. Remove knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14742 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Jun 16 11:58:00 UTC 2021 on sn-devel-184 commit ac10058d7f6b4605157f508189a448310f5f18da Author: Jeremy Allison Date: Tue Jun 15 15:11:20 2021 -0700 s3: torture: Add POSIX-SYMLINK-SETPATHINFO regression test. This ensure we never blunder into indirecting a NULL fsp pointer in the server. Currently this crashes the server in several info levels. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14742 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/selftest/tests.py| 1 + source3/smbd/trans2.c| 14 +++- source3/torture/proto.h | 1 + source3/torture/test_posix.c | 194 +++ source3/torture/torture.c| 4 + 5 files changed, 213 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index c86e6bc9c7d..5e9bebdcbce 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -267,6 +267,7 @@ posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA", "POSIX-DIR-DEFAULT-ACL", "POSIX-SYMLINK-RENAME", "POSIX-SYMLINK-GETPATHINFO", + "POSIX-SYMLINK-SETPATHINFO", ] for t in posix_tests: diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index d6a1ea81ce0..23c13da4c58 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -744,6 +744,10 @@ NTSTATUS set_ea(connection_struct *conn, files_struct *fsp, return NT_STATUS_EAS_NOT_SUPPORTED; } + if (fsp == NULL) { + return NT_STATUS_INVALID_HANDLE; + } + posix_pathnames = (fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH); status = refuse_symlink_fsp(fsp); @@ -6862,7 +6866,7 @@ static NTSTATUS smb_set_file_full_ea_info(connection_struct *conn, struct ea_list *ea_list = NULL; NTSTATUS status; - if (!fsp) { + if (fsp == NULL) { return NT_STATUS_INVALID_HANDLE; } @@ -7887,6 +7891,10 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn, return NT_STATUS_INVALID_PARAMETER; } + if (fsp == NULL) { + return NT_STATUS_INVALID_HANDLE; + } + status = check_access_fsp(fsp, FILE_WRITE_ATTRIBUTES); if (!NT_STATUS_IS_OK(status)) { return status; @@ -7944,6 +7952,10 @@ static NTSTATUS smb_set_info_standard(connection_struct *conn, return NT_STATUS_INVALID_PARAMETER; } + if (fsp == NULL) { + return NT_STATUS_INVALID_HANDLE; + } + /* create time */ ft.create_time = time_t_to_full_timespec(srv_make_unix_date2(pdata)); /* access time */ diff --git a/source3/torture/proto.h b/source3/torture/proto.h index 471609d2837..dfcbd815af0 100644 --- a/source3/torture/proto.h +++ b/source3/torture/proto.h @@ -95,6 +95,7 @@ bool run_posix_dir_default_acl_test(int dummy); bool run_case_insensitive_create(int dummy); bool run_posix_symlink_rename_test(int dummy); bool run_posix_symlink_getpathinfo_test(int dummy); +bool run_posix_symlink_setpathinfo_test(int dummy); bool run_nbench2(int dummy); bool run_async_echo(int dummy); diff --git a/source3/torture/test_posix.c b/source3/torture/test_posix.c index 85e4e6c510f..20b2b136761 100644 --- a/source3/torture/test_posix.c +++ b/source3/torture/test_posix.c @@ -1694,3 +1694,197 @@ out: TALLOC_FREE(frame); return correct; } + +/* List of info levels to try with a POSIX symlink path. */ + +static struct { + uint32_t level; + const char *name; + uint32_t data_len; +} posix_smb1_setpath_array[] = { + { SMB_SET_FILE_UNIX_BASIC, "SMB_SET_F
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 582030bae25 s3: torture: Add POSIX-SYMLINK-GETPATHINFO regression test. from 0ec865d9795 Fix for https://bugzilla.samba.org/show_bug.cgi?id=9634 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 582030bae25c65b2ae7176d427923c24b7e54220 Author: Jeremy Allison Date: Mon Jun 14 16:34:14 2021 -0700 s3: torture: Add POSIX-SYMLINK-GETPATHINFO regression test. This ensure we never blunder into indirecting a NULL fsp pointer in the server. We already pass this, but this test will ensure we continue to do so as we make fileserver changes. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jun 15 11:06:23 UTC 2021 on sn-devel-184 --- Summary of changes: source3/selftest/tests.py| 1 + source3/torture/proto.h | 1 + source3/torture/test_posix.c | 251 +++ source3/torture/torture.c| 4 + 4 files changed, 257 insertions(+) Changeset truncated at 500 lines: diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 4f82123c8f0..f79f4ac54fd 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -266,6 +266,7 @@ posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA", "POSIX-SYMLINK-CHMOD", "POSIX-DIR-DEFAULT-ACL", "POSIX-SYMLINK-RENAME", + "POSIX-SYMLINK-GETPATHINFO", ] for t in posix_tests: diff --git a/source3/torture/proto.h b/source3/torture/proto.h index 4e813c473b1..471609d2837 100644 --- a/source3/torture/proto.h +++ b/source3/torture/proto.h @@ -94,6 +94,7 @@ bool run_posix_symlink_chmod_test(int dummy); bool run_posix_dir_default_acl_test(int dummy); bool run_case_insensitive_create(int dummy); bool run_posix_symlink_rename_test(int dummy); +bool run_posix_symlink_getpathinfo_test(int dummy); bool run_nbench2(int dummy); bool run_async_echo(int dummy); diff --git a/source3/torture/test_posix.c b/source3/torture/test_posix.c index dc25db4c985..85e4e6c510f 100644 --- a/source3/torture/test_posix.c +++ b/source3/torture/test_posix.c @@ -24,6 +24,7 @@ #include "libsmb/proto.h" #include "../libcli/smb/smbXcli_base.h" #include "util_sd.h" +#include "trans2.h" extern struct cli_credentials *torture_creds; extern fstring host, workgroup, share, password, username, myname; @@ -1443,3 +1444,253 @@ out: TALLOC_FREE(frame); return correct; } + +/* List of info levels to try with a POSIX symlink path. */ + +static struct { + uint32_t level; + const char *name; +} posix_smb1_qpath_array[] = { + { SMB_INFO_STANDARD, "SMB_INFO_STANDARD"}, + { SMB_INFO_QUERY_EA_SIZE,"SMB_INFO_QUERY_EA_SIZE"}, + { SMB_INFO_IS_NAME_VALID,"SMB_INFO_IS_NAME_VALID"}, + { SMB_INFO_QUERY_EAS_FROM_LIST, "SMB_INFO_QUERY_EAS_FROM_LIST"}, + { SMB_INFO_QUERY_ALL_EAS,"SMB_INFO_QUERY_ALL_EAS"}, + { SMB_FILE_BASIC_INFORMATION,"SMB_FILE_BASIC_INFORMATION"}, + { SMB_FILE_STANDARD_INFORMATION, "SMB_FILE_STANDARD_INFORMATION"}, + { SMB_FILE_EA_INFORMATION, "SMB_FILE_EA_INFORMATION"}, + { SMB_FILE_ALTERNATE_NAME_INFORMATION,"SMB_FILE_ALTERNATE_NAME_INFORMATION"}, + { SMB_QUERY_FILE_NAME_INFO, "SMB_QUERY_FILE_NAME_INFO"}, + { SMB_FILE_NORMALIZED_NAME_INFORMATION,"SMB_FILE_NORMALIZED_NAME_INFORMATION"}, + { SMB_FILE_ALLOCATION_INFORMATION, "SMB_FILE_ALLOCATION_INFORMATION"}, + { SMB_FILE_END_OF_FILE_INFORMATION, "SMB_FILE_END_OF_FILE_INFORMATION"}, + { SMB_FILE_ALL_INFORMATION, "SMB_FILE_ALL_INFORMATION"}, + { SMB_FILE_INTERNAL_INFORMATION, "SMB_FILE_INTERNAL_INFORMATION"}, + { SMB_FILE_ACCESS_INFORMATION, "SMB_FILE_ACCESS_INFORMATION"}, + { SMB_FILE_NAME_INFORMATION, "SMB_FILE_NAME_INFORMATION"}, + { SMB_FILE_DISPOSITION_INFORMATION, "SMB_FILE_DISPOSITION_INFORMATION"}, + { SMB_FILE_POSITION_INFORMATION, "SMB_FILE_POSITION_INFORMATION"}, + { SMB_FILE_MODE_INFORMATION, "SMB_FILE_MODE_INFORMATION"}, + { SMB_FILE_ALIGNMENT_INFORMATION,"SMB_FILE_ALIGNMENT_INFORMATION"}, + { SMB_FILE_STREAM_INFORMATION, "SMB_FILE_STREAM_INFORMATION"}, + { SMB_FILE_COMPRESSION_INFORMATION, "SMB_FILE_COMPRESSION_INFORMATION"}, + { SMB_FILE_NETWORK_OPEN_INFORMATION, "SMB_FILE_NETWORK_OPEN_INFORMATI
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4f20d310af2 s3: smbd: Remove erroneous TALLOC_FREE(smb_fname_parent) in change_file_owner_to_parent() error path. via f4f1206c75e VFX: vxfs: Fixup some warnings via 748189b29c5 VFS: vxfs: ifdef out vxfs_sys_acl_set_fd via 0f5c6c0aa01 s3/smbd: Remove unecessary 'else' block via eb8d1265dc0 s3/smbd: dos_mode_check_compressed: remove smb_fname, conn fn parms via 77f15f58349 s3/smbd: dos_mode_post: remove smb_fname param via 34a6ed2136c s3/smbd: call dos_mode_post with fsp via 72ace149f96 s3: smbd: Protect dos_mode_at_send() from running into a symlink. from 4152499652c pytests: add dns_aging, embracing and extending ageing tests https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4f20d310af2bb1f96dea4810a7130492cc4cfc55 Author: Jeremy Allison Date: Wed Jun 9 12:22:26 2021 -0700 s3: smbd: Remove erroneous TALLOC_FREE(smb_fname_parent) in change_file_owner_to_parent() error path. Caller is still using this ! BUG: https://bugzilla.samba.org/show_bug.cgi?id=14736 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Jun 11 10:17:46 UTC 2021 on sn-devel-184 commit f4f1206c75ea0b3da513e9a11012f693780ff486 Author: Noel Power Date: Wed Jun 9 14:58:41 2021 +0100 VFX: vxfs: Fixup some warnings ../../source3/modules/vfs_vxfs.c:343:6: error: unused variable ‘i’ [-Werror=unused-variable] int i, offset = 0; ^ ../../source3/modules/vfs_vxfs.c:342:17: error: unused variable ‘n_id’ [-Werror=unused-variable] uint32_t e_id, n_id; ^~~~ ../../source3/modules/vfs_vxfs.c:342:11: error: unused variable ‘e_id’ [-Werror=unused-variable] uint32_t e_id, n_id; ^~~~ ../../source3/modules/vfs_vxfs.c:341:35: error: unused variable ‘n_perm’ [-Werror=unused-variable] uint16_t e_type, n_type, e_perm, n_perm; ^~ ../../source3/modules/vfs_vxfs.c:341:27: error: unused variable ‘e_perm’ [-Werror=unused-variable] uint16_t e_type, n_type, e_perm, n_perm; ^~ ../../source3/modules/vfs_vxfs.c: In function ‘vxfs_compare’: ../../source3/modules/vfs_vxfs.c:407:6: error: unused variable ‘i’ [-Werror=unused-variable] int i, count = 0; ^ Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 748189b29c58cebe70e16ee82a7dfd2ace1955b9 Author: Noel Power Date: Thu Jun 10 14:52:04 2021 +0100 VFS: vxfs: ifdef out vxfs_sys_acl_set_fd as the sys_acl_set_fd_fn definition for vxfs_sys_acl_set_fd is ifdef'ed out we also need ifdef out the vxfs_sys_acl_set_fd implementation itself otherwise we get the following error. source3/modules/vfs_vxfs.c:484:12: error: ‘vxfs_sys_acl_set_fd’ defined but not used [-Werror=unused-function] static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle, Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 0f5c6c0aa01245276d8d399269576f5296e00f36 Author: Noel Power Date: Thu Jun 10 14:11:03 2021 +0100 s3/smbd: Remove unecessary 'else' block This is an inconsequential cosmetic change, it just caught my eye as looking a bit out of place compared to the surrounding code style. Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit eb8d1265dc053086e9fb802eec0f91dff2ee6aee Author: Noel Power Date: Thu Jun 10 11:32:06 2021 +0100 s3/smbd: dos_mode_check_compressed: remove smb_fname, conn fn parms smb_fname is unused and we can get conn from the fsp passed in Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 77f15f58349b53ad21802a2e4c61fdc57c5fc7fc Author: Noel Power Date: Thu Jun 10 10:04:39 2021 +0100 s3/smbd: dos_mode_post: remove smb_fname param Signed-off-by: Noel Power Reviewed-by: Jeremy Allison Date: Thu Jun 10 09:45:02 2021 +0100 s3/smbd: call dos_mode_post with fsp Next commit can remove smb_name param from dos_mode_post signature. Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 72ace149f96cf98c2ea68f93306b5b50228f6e65 Author: Jeremy Allison Date: Thu Jun 10 10:30:17 2021 -0700 s3: smbd: Protect dos_mode_at_send() from running into a symlink. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/modules/vfs_vxfs.c | 9 + source3/smbd/dosmode.c | 36 ++-- source3/smbd/open.c| 5 + 3 files changed, 28 insertions(+), 22 deletions(-) Changeset truncated at 500 lines: diff --git a/source3
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via eef0f736209 s3:smbd: Remove unnessesary NULL check for req via 8204e5f93f8 s3:smbd: Remove unnessesary NULL check for fsp via d6eff9c413f librpc: Make sure num_protocols is initialized via 9b7bef7f876 s3:smbd: Make sure smb_fname is set and not NULL in dos_mode_post() from f44918e6c83 s3: VFS: default: Add proc_fd's fallback for vfswrap_fchown(). https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit eef0f73620912a6a299a2558bd76e9454141c6cd Author: Andreas Schneider Date: Thu Jun 10 09:14:22 2021 +0200 s3:smbd: Remove unnessesary NULL check for req We already dereference req earlier. So if it is NULL it already segfaulted much earlier. Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Pavel Filipenský Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Jun 10 11:22:19 UTC 2021 on sn-devel-184 commit 8204e5f93f8a8721973095a3475d14594401dc3e Author: Andreas Schneider Date: Thu Jun 10 09:05:53 2021 +0200 s3:smbd: Remove unnessesary NULL check for fsp We already dereference fsp earlier. So if it is NULL it already segfaulted much earlier. Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Pavel Filipenský Reviewed-by: Noel Power commit d6eff9c413fe4789a061fdde7105d0553a419f59 Author: Andreas Schneider Date: Thu Jun 10 08:53:19 2021 +0200 librpc: Make sure num_protocols is initialized Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Pavel Filipenský Reviewed-by: Noel Power commit 9b7bef7f8761b05e946185b9262dd089d1eeed15 Author: Andreas Schneider Date: Thu Jun 10 08:51:03 2021 +0200 s3:smbd: Make sure smb_fname is set and not NULL in dos_mode_post() Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Pavel Filipenský Reviewed-by: Noel Power --- Summary of changes: librpc/rpc/binding.c | 2 +- source3/smbd/dosmode.c | 1 + source3/smbd/reply.c | 2 +- source3/smbd/trans2.c | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c index 6588f43cc9d..7a2dcd472ea 100644 --- a/librpc/rpc/binding.c +++ b/librpc/rpc/binding.c @@ -1430,7 +1430,7 @@ _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct epm_tower *tower) { const enum epm_protocol *protseq = NULL; - size_t i, num_protocols; + size_t i, num_protocols = 0; struct ndr_syntax_id abstract_syntax; NTSTATUS status; diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index bcca7e0a50a..28724ad75bc 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -689,6 +689,7 @@ static uint32_t dos_mode_post(uint32_t dosmode, if (fsp != NULL) { smb_fname = fsp->fsp_name; } + SMB_ASSERT(smb_fname != NULL); /* * According to MS-FSA a stream name does not have diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index d453eb5e6f4..abec7857951 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3572,7 +3572,7 @@ void reply_unlink(struct smb_request *req) goto out; } - if (req != NULL && !req->posix_pathnames) { + if (!req->posix_pathnames) { char *lcomp = get_original_lcomp(ctx, conn, name, diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index a1a3e92fafd..d6a1ea81ce0 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7919,7 +7919,7 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn, return status; } - if (fsp != NULL && fsp->fsp_flags.modified) { + if (fsp->fsp_flags.modified) { trigger_write_time_update_immediate(fsp); } return NT_STATUS_OK; @@ -7964,7 +7964,7 @@ static NTSTATUS smb_set_info_standard(connection_struct *conn, return status; } - if (fsp != NULL && fsp->fsp_flags.modified) { + if (fsp->fsp_flags.modified) { trigger_write_time_update_immediate(fsp); } return NT_STATUS_OK; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f44918e6c83 s3: VFS: default: Add proc_fd's fallback for vfswrap_fchown(). from 767287920aa selftest/gdb_backtrace: remove duplicate assignment. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f44918e6c83c89936156eb24c982a897c9c45f61 Author: Jeremy Allison Date: Wed Jun 9 15:57:38 2021 -0700 s3: VFS: default: Add proc_fd's fallback for vfswrap_fchown(). https://bugzilla.samba.org/show_bug.cgi?id=14734 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Jun 10 09:16:22 UTC 2021 on sn-devel-184 --- Summary of changes: source3/modules/vfs_default.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 187b68a78cf..79531f83483 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2514,7 +2514,31 @@ static int vfswrap_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t ui int result; START_PROFILE(syscall_fchown); - result = fchown(fsp_get_io_fd(fsp), uid, gid); + if (!fsp->fsp_flags.is_pathref) { + result = fchown(fsp_get_io_fd(fsp), uid, gid); + END_PROFILE(syscall_fchown); + return result; + } + + if (fsp->fsp_flags.have_proc_fds) { + int fd = fsp_get_pathref_fd(fsp); + const char *p = NULL; + char buf[PATH_MAX]; + + p = sys_proc_fd_path(fd, buf, sizeof(buf)); + if (p != NULL) { + result = chown(p, uid, gid); + } else { + result = -1; + } + END_PROFILE(syscall_fchown); + return result; + } + + /* +* This is no longer a handle based call. +*/ + result = chown(fsp->fsp_name->base_name, uid, gid); END_PROFILE(syscall_fchown); return result; #else -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1d781bbff84 s3: smbd: Allow SMB1+UNIX extensions rename of dangling symlink. via 0c2ceb0435c s3: torture: Add regression test for renaming SMB1+POSIX symlinks, dangling and real. via 6917e324660 s3: smbd: Remove use of synthetic_pathref() in rename_internals_fsp(). from f96cc297111 smbd: correctly initialize close timestamp fields https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1d781bbff84667b3ada4afc06c1d15829754dcb4 Author: Jeremy Allison Date: Fri May 21 10:53:49 2021 -0700 s3: smbd: Allow SMB1+UNIX extensions rename of dangling symlink. Remove knownfail. Only in master, so no bug number needed. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon May 24 17:47:40 UTC 2021 on sn-devel-184 commit 0c2ceb0435c7d03d72c7f9c29b0240f944f6cc42 Author: Jeremy Allison Date: Fri May 21 11:14:19 2021 -0700 s3: torture: Add regression test for renaming SMB1+POSIX symlinks, dangling and real. Mark as knownfail. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 6917e3246603b9d84133b10f0415e1cc11d184f7 Author: Jeremy Allison Date: Fri May 21 10:27:09 2021 -0700 s3: smbd: Remove use of synthetic_pathref() in rename_internals_fsp(). As we're renaming an open file we don't need to do another open, we already have an fsp here. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/selftest/tests.py| 1 + source3/smbd/reply.c | 54 + source3/torture/proto.h | 1 + source3/torture/test_posix.c | 134 +++ source3/torture/torture.c| 4 ++ 5 files changed, 169 insertions(+), 25 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 13f0466802e..d4f9ea27ba6 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -265,6 +265,7 @@ posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA", "POSIX-SYMLINK-PARENT", "POSIX-SYMLINK-CHMOD", "POSIX-DIR-DEFAULT-ACL", + "POSIX-SYMLINK-RENAME", ] for t in posix_tests: diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 4ba3b0ee624..1b670020143 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -7829,33 +7829,25 @@ NTSTATUS rename_internals_fsp(connection_struct *conn, (lp_map_archive(SNUM(conn)) || lp_store_dos_attributes(SNUM(conn { - struct smb_filename *pathref = NULL; - status = synthetic_pathref(ctx, - conn->cwd_fsp, - smb_fname_dst->base_name, - smb_fname_dst->stream_name, - NULL, - smb_fname_dst->twrp, - smb_fname_dst->flags, - ); - if (NT_STATUS_IS_OK(status)) { + /* +* We must set the archive bit on the newly renamed +* file. +*/ + ret = SMB_VFS_FSTAT(fsp, >fsp_name->st); + if (ret == 0) { + uint32_t old_dosmode; + old_dosmode = fdos_mode(fsp); /* -* We must set the archive bit on the newly renamed -* file. +* We can use fsp->fsp_name here as it has +* already been changed to the new name. */ - ret = SMB_VFS_FSTAT(fsp, >st); - if (ret == 0) { - uint32_t old_dosmode; - fsp->fsp_name->st = pathref->st; - old_dosmode = fdos_mode(fsp); - file_set_dosmode(conn, - pathref, - old_dosmode | FILE_ATTRIBUTE_ARCHIVE, - NULL, -
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b7f62e13933 s3: smbd: Ensure POSIX default ACL is mapped into returned Windows ACL for directory handles. via 544289b54bb s3: torture: Add test for bug 14708 - POSIX default ACL not mapped into returned Windows ACL for directory handles. from 7791acb074b python: Make credentials cache test run against Windows https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b7f62e13933da14c381f70cd46ad13849b108e68 Author: Jeremy Allison Date: Mon May 17 15:34:55 2021 -0700 s3: smbd: Ensure POSIX default ACL is mapped into returned Windows ACL for directory handles. Remove knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14708 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed May 19 09:22:56 UTC 2021 on sn-devel-184 commit 544289b54bbf85098f4cc354f655290600c7f5ba Author: Jeremy Allison Date: Tue May 18 12:11:46 2021 -0700 s3: torture: Add test for bug 14708 - POSIX default ACL not mapped into returned Windows ACL for directory handles. Knownfail for now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14708 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/selftest/tests.py| 1 + source3/smbd/posix_acls.c| 12 +- source3/torture/proto.h | 1 + source3/torture/test_posix.c | 260 +++ source3/torture/torture.c| 4 + source3/wscript_build| 2 + 6 files changed, 279 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 11d0a41bda9..20a0e63bed7 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -264,6 +264,7 @@ posix_tests = ["POSIX", "POSIX-APPEND", "POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA", "POSIX-STAT", "POSIX-SYMLINK-PARENT", "POSIX-SYMLINK-CHMOD", + "POSIX-DIR-DEFAULT-ACL", ] for t in posix_tests: diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index c3e00fa2475..489a4695ba1 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -3426,6 +3426,7 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info, { SMB_STRUCT_STAT sbuf; SMB_ACL_T posix_acl = NULL; + SMB_ACL_T def_acl = NULL; struct pai_val *pal; TALLOC_CTX *frame = talloc_stackframe(); NTSTATUS status; @@ -3444,10 +3445,19 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info, /* Get the ACL from the fd. */ posix_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, frame); + /* If it's a directory get the default POSIX ACL. */ + if(fsp->fsp_flags.is_directory) { + def_acl = SMB_VFS_SYS_ACL_GET_FILE(fsp->conn, + fsp->fsp_name, + SMB_ACL_TYPE_DEFAULT, + frame); + def_acl = free_empty_sys_acl(fsp->conn, def_acl); + } + pal = fload_inherited_info(fsp); status = posix_get_nt_acl_common(fsp->conn, fsp->fsp_name->base_name, -, pal, posix_acl, NULL, +, pal, posix_acl, def_acl, security_info, mem_ctx, ppdesc); TALLOC_FREE(frame); return status; diff --git a/source3/torture/proto.h b/source3/torture/proto.h index 57b1b5fea13..bc2d8c7b3f2 100644 --- a/source3/torture/proto.h +++ b/source3/torture/proto.h @@ -91,6 +91,7 @@ bool run_posix_readlink_test(int dummy); bool run_posix_stat_test(int dummy); bool run_posix_symlink_parent_test(int dummy); bool run_posix_symlink_chmod_test(int dummy); +bool run_posix_dir_default_acl_test(int dummy); bool run_case_insensitive_create(int dummy); bool run_nbench2(int dummy); diff --git a/source3/torture/test_posix.c b/source3/torture/test_posix.c index 33a28866f9f..8c1306c5066 100644 --- a/source3/torture/test_posix.c +++ b/source3/torture/test_posix.c @@ -23,6 +23,7 @@ #include "libsmb/clirap.h" #include "libsmb/proto.h" #include "../libcli/smb/smbXcli_base.h" +#include "util_sd.h" extern struct cli_credentials *torture_creds; extern fstring host, workgroup, share, password, username, myname; @@ -1049,3 +1050,262 @@ out: TALLOC_FREE(frame); return correct; } + +/* + Ensure we get an ACL containing OI|IO ACE entries +
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e4ad0aa373a VFS: Update status of SMB_VFS_CHMOD from 768d48fca9f tests python krb5: MS-KILE client principal look-up https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e4ad0aa373afc94b15a5d538deea53bfa2d14856 Author: Noel Power Date: Mon Apr 12 10:48:34 2021 +0100 VFS: Update status of SMB_VFS_CHMOD Missed when SMB_VFS_CHMOD() was removed. Signed-off-by: Noel Power Reviewed-by: Ralph Boehme Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Apr 12 11:11:06 UTC 2021 on sn-devel-184 --- Summary of changes: source3/modules/The_New_VFS.org | 2 +- source3/modules/The_New_VFS.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/modules/The_New_VFS.org b/source3/modules/The_New_VFS.org index afb2ed84f1c..5dc899befb6 100644 --- a/source3/modules/The_New_VFS.org +++ b/source3/modules/The_New_VFS.org @@ -203,7 +203,7 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_BRL_UNLOCK_WINDOWS() | [[fsp][fsp]] | - | | SMB_VFS_CHDIR() | [[Path][Path]] | Todo | | SMB_VFS_CHFLAGS() | [[Path][Path]] | Todo | -| SMB_VFS_CHMOD() | [[Path][Path]] | Todo | +| SMB_VFS_CHMOD() | [[Path][Path]] | - | | SMB_VFS_CLOSE() | [[fsp][fsp]] | - | | SMB_VFS_CLOSEDIR()| [[fsp][fsp]] | - | | SMB_VFS_CONNECT() | [[Disk][Disk]] | - | diff --git a/source3/modules/The_New_VFS.txt b/source3/modules/The_New_VFS.txt index ecff08972d0..5121229dc0a 100644 --- a/source3/modules/The_New_VFS.txt +++ b/source3/modules/The_New_VFS.txt @@ -271,7 +271,7 @@ Table of Contents SMB_VFS_BRL_UNLOCK_WINDOWS() [fsp] - SMB_VFS_CHDIR()[Path] Todo SMB_VFS_CHFLAGS() [Path] Todo - SMB_VFS_CHMOD()[Path] Todo + SMB_VFS_CHMOD()[Path] - SMB_VFS_CLOSE()[fsp] - SMB_VFS_CLOSEDIR() [fsp] - SMB_VFS_CONNECT() [Disk] - -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 534de9b2827 VFS: Remove SMB_VFS_CHMOD, no longer used via 8b24b864357 s3/modules: VFS: unityed_media: Remove um_chmod function via ca6764aff3a s3/modules: VFS: time_audit: Remove smb_time_audit_chmod via ad45e014569 s3/modules: VFS: snapper: Remove snapper_gmt_chmod via 04d6f4a153f s3/modules: VFS: shadow_copy2: Remove shadow_copy2_chmod via 205a20c s3/modules: VFS: media_harmony: Remove mh_chmod via 2505719cdd1 s3/modules: VFS: gpfs: Remove vfs_gpfs_chmod() function via 9cfbd8cb7fa s3/modules: VFS: Remove vfs_gluster_chmod() function via 2bcd5b92e03 s3/modules: VFS: full_audit: Remove smb_full_audit_chmod() function via 3df8106edc8 s3/modules: VFS: fruit: Remove fruit_chmod via 87223ed5b0d s3/modules: VFS: fake_acls: Remove fake_acls_chmod() function via 8f680b45b0e s3/modules: VFS: extd_audit: Remove audit_chmod() function via 27ae0e1e37c s3/modules: VFS: cep_snapshots: remove ceph_snap_gmt_chmod() function via 25c53f14997 s3/modules: VFS: ceph: Remove cephwrap_chmod() function via bf90930a038 s3/modules: VFS: catia: Remove catia_chmod() function via b1a5c292cd2 s3/modules: VFS: cap: remove cap_chmod via f4e1598bbbf s3/modules: VFS: audit: Remove audit_chmod via d87123648b8 s3/modules: VFS: acl_common: Remove chmod_acl_module_common() function via a773d5e321f s3/modules: VFS: acl_xattr: Remove call to chmod_acl_module_common() via 726160a8ae6 s3/modules: VFS: acl_tdb: Remove call to chmod_acl_module_common() via 5cad228f555 s3/torture: Make cmd_chmod now use SMB_VFS_FCHMOD via dda3d953a00 s3/modules: linux_xfs_sgid_mkdirat() SMB_VFS_NEXT_FCHMOD => SMB_VFS_NEXT_CHMOD via cb571d2b476 s3/modules: nfs4acl_xattr_fset_nt_acl VFS_SMB_NEXT_CHMOD => VFS_SMB_NEXT_FCHMOD via 34949219eda s3/smbd: file_set_dosmode SMB_VFS_CHMOD => SMB_VFS_FCHMOD via 9722732b186 s3/smbd: SMB_VFS_CHMOD -> SMB_VFS_FCHMOD via 7501407f988 s3/modules: VFS: snapper: Add new fchmod_fn implementation via a412b5cc793 s3/modules: VFS: shadow_copy2: Add new fchmod_fn implementation via f54ec00eca5 s3/modules: VFS: fruit: Add new fchmod_fn implementation via c1e9aea0da1 s3/modules: VFS: ceph_snapshots: Add new fchmod_fn implementation via 74ecb467073 s3/modules: make chmod_acl_module_common less strict so fchmod can run via a749da2a5d6 VFS: ceph: Allow cephwrap_fchmod() to cope with pathref fsps. via fcf696bfa28 VFS: gluster: Allow vfs_gluster_fchmod() to cope with pathref fsps. via 6ad10836d6e s3/modules: fchmod: fallback to path based chmod if pathref via f923d1f474f vfs_default: require fchmod() via 1a68d34c232 VFS: Fix version SMB_VFS_GET_DOS_ATTRIBUTES was removed in from 9386e6ef5dd s3: VFS: streams_xattr: Now we know we will never be doing ACL operations on streams, delete the now unneeded code. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 534de9b28274165ac5d86f0c79fa2d543c0f09ed Author: Noel Power Date: Thu Apr 8 13:03:57 2021 +0100 VFS: Remove SMB_VFS_CHMOD, no longer used --- / \ / REST \ /IN \ /PEACE\ / \ | | | SMB_VFS_CHMOD | | | | | | 08 April| | 2021 | | | | | *| * * * | * _)/\\_//(\/(/\)/\//\/\|_)___ Signed-off-by: Noel Power Reviewed-by: Ralph Boehme Autobuild-User(master): Noel Power Autobuild-Date(master): Sun Apr 11 23:25:31 UTC 2021 on sn-devel-184 commit 8b24b8643571ba3fb9f2d138e5f779ab514b3697 Author: Noel Power Date: Thu Apr 8 13:01:06 2021 +0100 s3/modules: VFS: unityed_media: Remove um_chmod function Signed-off-by: Noel Power Reviewed-by: Ralph Boehme commit ca6764aff3a716bba76307d99442f0b8d394513a Author: Noel Power Date: Thu Apr 8 13:00:36 2021 +0100 s3/modules: VFS: time_audit: Remove smb_time_audit_chmod Signed-off-by: Noel Power Reviewed-by: Ralph Boehme commit ad45e014569e6b846d9af4e26b8bd4261b079086 Author: Noel Power Date: Fri Apr 9 1
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d6a16ad00e4 s3:modules:vfs_virusfilter: Recent New_VFS changes break vfs_virusfilter_openat. via 4af98681425 s3: VFS: default: vfswrap_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. via 8f38f886ffa s3: VFS: time_audit: Log full pathname as smb_time_audit_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. via 49bcb913398 s3: VFS: full_audit: Log full pathname as smb_full_audit_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. via ea5c15358f1 s3: VFS: gluster: vfs_gluster_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. via c344ade7178 s3: VFS: ceph: cephwrap_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. from ec4794b5d9e s3:param: Fix segfault trying to add pcap printer without a [printers] share https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d6a16ad00e426a6f815215af71c071dd8e85a50a Author: Trever L. Adams Date: Sat Mar 13 12:47:21 2021 -0700 s3:modules:vfs_virusfilter: Recent New_VFS changes break vfs_virusfilter_openat. The_New_VFS introduces several changes that broke vfs_virusfilter_openat. The assert to make sure certain checks would work broke. This patch fixes those breaks and converts to the SMB_VFS_FSTAT_NEXT instead of SMB_VFS_STAT_NEXT. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14671 RN: vfs_virusfilter_openat support New_VFS FSTAT, avoid SMB_ASSERT(fsp_get_pathref_fd(dirfsp) == AT_FDCWD); problem. Signed-off-by: Trever L. Adams" Reviewed-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Mar 22 19:44:30 UTC 2021 on sn-devel-184 commit 4af9868142529187a87b30cd522a144ead76cc8c Author: Jeremy Allison Date: Tue Mar 16 18:26:43 2021 -0700 s3: VFS: default: vfswrap_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 8f38f886ffa0845626de4d94e45685376f790d46 Author: Jeremy Allison Date: Tue Mar 16 21:50:08 2021 -0700 s3: VFS: time_audit: Log full pathname as smb_time_audit_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 49bcb913398492f08a3d6d9b1ac36ff0563f71d7 Author: Jeremy Allison Date: Tue Mar 16 21:49:14 2021 -0700 s3: VFS: full_audit: Log full pathname as smb_full_audit_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit ea5c15358f12a6cd584b52039411e0feb526f380 Author: Jeremy Allison Date: Tue Mar 16 21:48:42 2021 -0700 s3: VFS: gluster: vfs_gluster_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit c344ade717853b2622602d2f1fa38d073ffc2810 Author: Jeremy Allison Date: Tue Mar 16 21:48:07 2021 -0700 s3: VFS: ceph: cephwrap_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- Summary of changes: source3/modules/vfs_ceph.c| 12 +--- source3/modules/vfs_default.c | 4 +--- source3/modules/vfs_full_audit.c | 11 ++- source3/modules/vfs_glusterfs.c | 10 -- source3/modules/vfs_time_audit.c | 14 -- source3/modules/vfs_virusfilter.c | 8 ++-- 6 files changed, 42 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index e2f3691bc4f..e371090c95d 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -1379,8 +1379,14 @@ static NTSTATUS cephwrap_create_dfs_pathat(struct vfs_handle_struct *handle, NTSTATUS status = NT_STATUS_NO_MEMORY; int ret; char *msdfs_link = NULL; + struct smb_filename *full_fname = NULL; - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + goto out; + } /* Form the msdfs_link contents */ msdfs_link = msdfs_link_string(frame, @@ -1392,7 +1398,7 @@ static NTSTATUS cephwrap_create_dfs_pathat(struct vfs_handle_struct *handle, ret = ceph_symlink(handle->data, msdfs_link, - smb_fname->bas
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1c9add54750 s3:modules:vfs_virusfilter: Recent talloc changes cause infinite start-up failure from 1c3e7f0f4de Suggest running './configure' rather than 'waf configure'. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1c9add54750cb7f2b49be69a548ce8bdb15e7ac2 Author: Trever L. Adams Date: Fri Feb 26 14:52:03 2021 -0800 s3:modules:vfs_virusfilter: Recent talloc changes cause infinite start-up failure Recent talloc changes cause the current check for failure to allocate to be incorrectly triggered. This patch ensures the original parameter is not NULL before attempting any talloc or strstr. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14634 RN: Fix failure of vfs_virusfilter starting due to talloc changes Signed-off-by: Trever L. Adams" Reviewed-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Mar 1 21:44:55 UTC 2021 on sn-devel-184 --- Summary of changes: source3/modules/vfs_virusfilter.c | 162 ++ 1 file changed, 95 insertions(+), 67 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/modules/vfs_virusfilter.c b/source3/modules/vfs_virusfilter.c index e0712b99b42..e7017ee1c7a 100644 --- a/source3/modules/vfs_virusfilter.c +++ b/source3/modules/vfs_virusfilter.c @@ -267,18 +267,24 @@ static int virusfilter_vfs_connect( infected_file_command = lp_parm_const_string( snum, "virusfilter", "infected file command", NULL); - config->infected_file_command = talloc_strdup(config, infected_file_command); - if (config->infected_file_command == NULL) { - DBG_ERR("virusfilter-vfs: out of memory!\n"); - return -1; + if (infected_file_command != NULL) { + config->infected_file_command = talloc_strdup( + config, + infected_file_command); + if (config->infected_file_command == NULL) { + DBG_ERR("virusfilter-vfs: out of memory!\n"); + return -1; + } } - scan_error_command = lp_parm_const_string( snum, "virusfilter", "scan error command", NULL); - config->scan_error_command = talloc_strdup(config, scan_error_command); - if (config->scan_error_command == NULL) { - DBG_ERR("virusfilter-vfs: out of memory!\n"); - return -1; + if (scan_error_command != NULL) { + config->scan_error_command = talloc_strdup(config, + scan_error_command); + if (config->scan_error_command == NULL) { + DBG_ERR("virusfilter-vfs: out of memory!\n"); + return -1; + } } config->block_access_on_error = lp_parm_bool( @@ -290,10 +296,12 @@ static int virusfilter_vfs_connect( quarantine_dir = lp_parm_const_string( snum, "virusfilter", "quarantine directory", tmp ? tmp : "/tmp/.quarantine"); - config->quarantine_dir = talloc_strdup(config, quarantine_dir); - if (config->quarantine_dir == NULL) { - DBG_ERR("virusfilter-vfs: out of memory!\n"); - return -1; + if (quarantine_dir != NULL) { + config->quarantine_dir = talloc_strdup(config, quarantine_dir); + if (config->quarantine_dir == NULL) { + DBG_ERR("virusfilter-vfs: out of memory!\n"); + return -1; + } } if (tmp != config->quarantine_dir) { @@ -311,42 +319,52 @@ static int virusfilter_vfs_connect( quarantine_prefix = lp_parm_const_string( snum, "virusfilter", "quarantine prefix", VIRUSFILTER_DEFAULT_QUARANTINE_PREFIX); - config->quarantine_prefix = talloc_strdup(config, quarantine_prefix); - if (config->quarantine_prefix == NULL) { - DBG_ERR("virusfilter-vfs: out of memory!\n"); - return -1; + if (quarantine_prefix != NULL) { + config->quarantine_prefix = talloc_strdup(config, + quarantine_prefix); + if (config->quarantine_prefix == NULL) { + DBG_ERR("virusfilter-vfs: out of memory!\n"); +
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 7a077f152aa s3:smbd:trans2.c - add twrp to tmp smb_fname in smbd_do_qfsinfo via 9bf9b998088 dbcheck: clarify check_object userparams via 83371443898 dbcheck: check_object/userparams: use variable for clarity via 22447a51598 dbcheck: reduce useless use of str(attrname) via 0dd736ff334 dbcheck: better disambiguate 'attrs' via 206a028e1e8 dbcheck: split out attr calculations from check_object() via 43530f087de dbcheck: add a helper function for attr tracking via b21287c2f49 dbcheck: do not add duplicate attrs for checking via 6b4ff458055 dbcheck: check_object() caches of lower case attr names via 25a94fa4743 dbcheck: make rIDSetReferences attr check case-insensitve from 6601b3ac544 bootstrap: Update distro list in README.md https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 7a077f152aa3e1e09b4228ae24780fa613540a68 Author: Andrew Walker Date: Tue Dec 8 10:36:10 2020 -0500 s3:smbd:trans2.c - add twrp to tmp smb_fname in smbd_do_qfsinfo Preserve VSS-related timestamp in temporary smb_filename before calling vfs_stat_fn() in smbd_do_qfsinfo. Otherwise, we can fail here on smb2_getinfo requests if file does not exist outside of shadow copy path. Signed-off-by: Andrew Walker Reviewed-by: Ralph Boehme Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Dec 15 15:32:18 UTC 2020 on sn-devel-184 commit 9bf9b998088b181955994da2004bf459ef131037 Author: Douglas Bagnall Date: Wed Dec 9 11:50:37 2020 +1300 dbcheck: clarify check_object userparams Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 83371443898aacdc6033ccf20bc67d4033b96767 Author: Douglas Bagnall Date: Wed Dec 9 11:38:48 2020 +1300 dbcheck: check_object/userparams: use variable for clarity Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 22447a5159867729559ae47c6fc20159be8f4c25 Author: Douglas Bagnall Date: Wed Dec 9 11:37:48 2020 +1300 dbcheck: reduce useless use of str(attrname) it's already a string! Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 0dd736ff3343ce19f2fef3132285d4595aa54afb Author: Douglas Bagnall Date: Wed Dec 9 11:34:50 2020 +1300 dbcheck: better disambiguate 'attrs' We had too many things called 'attrs'; now we have just one, but we don't want it to look like it is *the* one. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 206a028e1e8c83fa1fc2a7b3bbe4a573eb315ff8 Author: Douglas Bagnall Date: Fri Dec 4 13:17:24 2020 +1300 dbcheck: split out attr calculations from check_object() check_object is too long! Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 43530f087deab648708508445d4dea160de46889 Author: Douglas Bagnall Date: Fri Dec 4 13:10:49 2020 +1300 dbcheck: add a helper function for attr tracking Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit b21287c2f4922abb76ead510680bd489c6cf3cf9 Author: Douglas Bagnall Date: Fri Dec 4 13:06:25 2020 +1300 dbcheck: do not add duplicate attrs for checking Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 6b4ff45805550216a47577a2ee2fa04be305fe61 Author: Douglas Bagnall Date: Fri Dec 4 12:57:57 2020 +1300 dbcheck: check_object() caches of lower case attr names The construct `'name' in map(str.lower, attrs)` is doubly inefficient, because not only is it running the lower() function too often, it is searching linearly in a temporary iterator for membership. So we make a set, and use that. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 25a94fa4743f4bda9924786775aba43bb8c58c0d Author: Douglas Bagnall Date: Fri Dec 4 13:56:56 2020 +1300 dbcheck: make rIDSetReferences attr check case-insensitve Yes, it looks inefficient, but that's because it is just trying to fit in. Very soon we will fix it it properly. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: python/samba/dbchecker.py | 127 +- source3/smbd/trans2.c | 7 ++- 2 files changed, 86 insertions(+), 48 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index 28b56edaafb..364dc9427d7 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -250,7 +250,7 @@ class dbcheck(object): for object in res: self.dn_set.add(str(object.dn)) -error_count += self.check_object(object.dn, attrs=attrs
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via cc9ff79d86c dbcheck: err_normalise-mismatch_replace: no msg if no error via f1be8813b01 dbcheck: fix doc for err_normalise_mismatch* via c28a3dd6d27 dbcheck: fix doc for do_rename() via 17fb635532d dbcheck: remove unused fix_incorrect_deleted_objects flag via 0aec5b930d9 dbcheck: improve some duplicate doc strings via 99cdb2191e9 dbcheck: drop py2 support from dump_attr_values() via 713117401c8 dbcheck: don't try to stringify values list twice via 081d12de529 dbcheck: add docstring for err_odd_userParameters via 9fabe3aafdb dbcheck: fix documentation for err_doubled_userParameters via c7b39f1cea0 dbcheck: fix documentation and typo for err_utf_userParameters via fa0350374d3 dbcheck: fix documentation for err_base64_userParameters via 3afd594273f dbcheck: fix documentation for err_duplicate_values via 9938a9f7db3 selftest/subunit: python file modernisation via 02c3a66cbec drs_utils: remove unused sendRemoveDsServer() via a8d1a6c59b4 python: remove unused provision.check_install() via e253c45c6d1 samba-tool gpo: use common attr_default via 816dee1a132 samba-tool drs: move attr_default to common via 2c48e90fad0 samba-tool pso uses common timestamp functions via c8d3547c5fa samba-tool domain: move timestamp functions to common from 14768d0d544 s4:torture:smb2: remove unused fallback defines in oplock.c https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit cc9ff79d86c64cc25c5618866c95f308204716dd Author: Douglas Bagnall Date: Fri Dec 4 11:53:48 2020 +1300 dbcheck: err_normalise-mismatch_replace: no msg if no error Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Dec 9 17:04:23 UTC 2020 on sn-devel-184 commit f1be8813b01227c0c18052b622899026eb4b14d0 Author: Douglas Bagnall Date: Fri Dec 4 11:52:40 2020 +1300 dbcheck: fix doc for err_normalise_mismatch* Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit c28a3dd6d27e60ca84933dac41f0f696eb963b41 Author: Douglas Bagnall Date: Fri Dec 4 11:51:42 2020 +1300 dbcheck: fix doc for do_rename() Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 17fb635532dffb51a2237f1291d215d94e433146 Author: Douglas Bagnall Date: Fri Dec 4 11:19:50 2020 +1300 dbcheck: remove unused fix_incorrect_deleted_objects flag This was introduced in db15993401f927fd2fcea1687c4155dce2272aa8 but not actually referenced then or since. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 0aec5b930d9ca278c9045e6b58e4de2b34d8c591 Author: Douglas Bagnall Date: Fri Dec 4 10:15:24 2020 +1300 dbcheck: improve some duplicate doc strings Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 99cdb2191e9ab633579f4e7951c2da042529b95d Author: Douglas Bagnall Date: Fri Dec 4 10:10:50 2020 +1300 dbcheck: drop py2 support from dump_attr_values() Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 713117401c85642dfa9de0772f0a9954a8b8d804 Author: Douglas Bagnall Date: Fri Dec 4 10:12:08 2020 +1300 dbcheck: don't try to stringify values list twice dump_attr_values already turns it into a comma separated list. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 081d12de529ba89e8eb3930dd3e1cbf394783394 Author: Douglas Bagnall Date: Fri Dec 4 12:34:52 2020 +1300 dbcheck: add docstring for err_odd_userParameters Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 9fabe3aafdb799db31cf222e186b5ac84b1ed024 Author: Douglas Bagnall Date: Fri Dec 4 12:34:22 2020 +1300 dbcheck: fix documentation for err_doubled_userParameters Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit c7b39f1cea0ef4b27c4897d20ca718c5eb195210 Author: Douglas Bagnall Date: Fri Dec 4 12:34:02 2020 +1300 dbcheck: fix documentation and typo for err_utf_userParameters pseudo, not psudo. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit fa0350374d3ffdf78e920361315556034730fde8 Author: Douglas Bagnall Date: Fri Dec 4 12:33:27 2020 +1300 dbcheck: fix documentation for err_base64_userParameters Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 3afd594273f659056f15b6e6a1a45b68824bf113 Author: Douglas Bagnall Date: Fri Dec 4 11:56:00 2020 +1300 dbcheck: fix documentation for err_duplicate_values Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 9938a9f7db37283a1e3d2c52e1246c573ecd649b Author: Douglas Bagnall Date: Thu Nov 19 16:44:42 2020 +1300 selftest/subunit: python
[SCM] Samba Shared Repository - branch master updated
cess via 62e99efa3d2 lib: addns: Fix ads_dns_lookup_ns(), ads_dns_query_dcs(), ads_dns_query_gcs(), ads_dns_query_kdcs(), ads_dns_query_pdc() to return size_t *. via 2ebf3191f2b lib: addns: Fix ads_dns_lookup_srv() and functions to return size_t * num servers. via a8e0d46ead7 s3: libsmb: internal_resolve_name() - get rid of the icount variables. via 1fc49be483c s3: libsmb: Make resolve_ads() return a size_t * address count. via 2a1c57f6fc9 s3: libsmb: Fix resolve_hosts() to return size_t * count of addresses. via f5dda19dd4a s3: libsmb: cleanup resolve_hosts() - don't change return values on fail. via e034072c969 libcli: nbt: Fix resolve_lmhosts_file_as_sockaddr() to return size_t * count of addresses. via da9c7b19380 libcli: nbt: cleanup resolve_lmhosts_file_as_sockaddr() - don't change return values on fail. via af6aaf62437 s3: libsmb: Convert the WINS and broadcast name functions to return size_t * num addresses. via dbab4626ef9 s3/libsmb: Cleanup parse_node_status() only set out params on success via 923648b0c42 s3: libsmb: Convert node_status_query() and associated functions and callers to expect a size_t * return. from 8f868b0ea0b winbind: Fix a memleak https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 67498ffd78799a658991092186a3886204302947 Author: Jeremy Allison Date: Wed Sep 9 10:58:20 2020 -0700 s3: libsmb: Cleanup - in internal_resolve_name() only write the out parameters on success. All callers already correctly initialize them. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Sep 15 11:33:35 UTC 2020 on sn-devel-184 commit c1d39295fb0e501f2ace47921b03cb0086c421a7 Author: Jeremy Allison Date: Wed Sep 9 10:48:19 2020 -0700 s3: Remove struct ip_service. --- / \ / REST \ /IN \ /PEACE\ / \ | | | struct ip_service | | | | | | 9 August| | In the year of the | |pandemic | | 2020 | *| * * * | * _)/\\_//(\/(/\)/\//\/\|_)___ Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 526fdaa747e2c03b644d1581e27af7a44dcd1b1d Author: Jeremy Allison Date: Wed Sep 9 10:46:49 2020 -0700 s3: libsmb: namequery. Rename remove_duplicate_addrs2_sa() to remove_duplicate_addrs2() It's now the only function. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit d627ef14885b7ab16b1d40b3954c1aa92e313330 Author: Jeremy Allison Date: Wed Sep 9 10:45:21 2020 -0700 s3: libsmb: namequery.c: Remove unused remove_duplicate_addrs2(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 5b6245d14b090162321d21e21a5f6da9c2f0cb77 Author: Jeremy Allison Date: Wed Sep 9 10:43:45 2020 -0700 s3: libsmb: namequery.c: Remove now unused internal_resolve_name() wrapper. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit a679c6c5a1f962d8132e5b773607d0722f9a9303 Author: Jeremy Allison Date: Wed Sep 9 10:42:46 2020 -0700 s3: libsmb: namequery.c: Remove now unused convert_ss2service(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 7d37b8ba1b000e292d3866dafb47881dc438db96 Author: Jeremy Allison Date: Wed Sep 9 10:42:09 2020 -0700 s3: libsmb: namequery.c: Remove now unused ip_service_to_samba_sockaddr(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 757934e8644436f26c1ce52dc22b3c212bae49ea Author: Jeremy Allison Date: Wed Sep 9 10:41:02 2020 -0700 3: libsmb: namequery: Convert _internal_resolve_name() -> internal_resolve_name() returning talloced samba_sockaddr arrays. Wrapper function internal_resolve_name() is now commented out, along with the now unused ip_service_to_samba_sockaddr() and convert_ss2service() functions. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit d3f6eccc98b73cb65389a3621e031941b2f047dc Author: Jeremy Allison Date: Wed Sep 9 10:24:13 2020 -0700 s3: libsmb: namequery: Add utility function sockaddr_array_to_samba_sockaddr_array(). Not yet used. Will help convert _internal_resolve_name() to int
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 21de9077a52 s3: libsmb: Fix bug in get_dc_list() introduced by ip-service cleanup. from b65fbade02f test_vfs_gpfs: Add test for file id generation https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 21de9077a52d4f0ff6e85710d26e971e2d3866d4 Author: Jeremy Allison Date: Tue Sep 8 18:19:07 2020 -0700 s3: libsmb: Fix bug in get_dc_list() introduced by ip-service cleanup. Do an early return on error. On success assign to the correct variables that are going to get copied into the 'out' parameters. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Sep 9 10:31:17 UTC 2020 on sn-devel-184 --- Summary of changes: source3/libsmb/namequery.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 0bcbb815a64..16b554b4430 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -3960,11 +3960,11 @@ static NTSTATUS get_dc_list(TALLOC_CTX *ctx, _iplist, _count, resolve_order); - if (NT_STATUS_IS_OK(status)) { - *ip_list = talloc_move(ctx, _iplist); - *ret_count = dc_count; + if (!NT_STATUS_IS_OK(status)) { + goto out; } - TALLOC_FREE(dc_iplist); + return_iplist = talloc_move(ctx, _iplist); + local_count = dc_count; goto out; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
via b7182c44176 s3: libsmb: Remove now unused get_kdc_list() (non-talloc version). via 11226af33e1 s3: utils: net_lookup. Convert to use get_kdc_list_talloc(). via 5307b0e319a s3/libads: Cleanup() get_kdc_ip_string, free kdc_str on error via 9d62c3e9819 s3/libads: Only set result to kdc_str on success via 8e1b6602f51 s3: libads: Make get_kdc_ip_string() use get_kdc_list_talloc(). via e8a491691da s3: libsmb: Add get_kdc_list_talloc(). via 02016acb2d8 s3: libsmb: Add utility funtion dup_ip_service_array(). via 6bee431be3c s3: libsmb: Cleanup - Use helper variable for return from namecache_fetch() in internal_resolve_name(). via a4073ae55c3 s3: libsmb: Cleanup in resolve_name_list(). via 6c28d715116 s3: libsmb: Cleanup - correctly error on sockaddr_storage_to_samba_sockaddr() fail. via b95eea6b292 s3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when calling resolve_name_list() via 13acac25cb4 s3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when calling get_sorted_dc_list() that may not touch returns on error. via c4c00d626cd s3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when calling get_kdc_list() that may not touch returns on error. via f11dce99cc3 s3: libsmb: discover_dc_netbios(). Remember to free on error return. from 0b742ec6a05 s4:smb_server: Use cli_credentials_init_server() for negprot https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 7a3c368d787b9a7e203d29de184dff5a4d241052 Author: Noel Power Date: Fri Sep 4 12:23:14 2020 +0100 s3: libsmb: Cleanup in get_dc_list() Don't modify out params (unless successful result), Signed-off-by: Noel Power Reviewed-by: Jeremy Allison Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Sep 7 14:46:58 UTC 2020 on sn-devel-184 commit 170051d61eb17955d93db88ab729dc53a60604b1 Author: Jeremy Allison Date: Thu Aug 27 12:17:07 2020 -0700 s3: libsmb: Now we only have namecache_store_sa(), rename it back to namecache_store(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 2989d736c4a95c73ccb6d828362425b30d580337 Author: Jeremy Allison Date: Thu Aug 27 12:14:13 2020 -0700 s3: libsmb: Remove use of struct ip_service from the namecache code. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 9da8d26fe069189ca920b23ae541da9848515749 Author: Jeremy Allison Date: Thu Aug 27 12:04:50 2020 -0700 s3: libsmb: Remove the last caller of namecache_store(). Convert to a struct samba_sockaddr array and use namecache_store_sa(). We can now remove the use of 'struct ip_list' from the namecache code. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 3dad456d8cb4fa2b03396cce9c04c07d6c3c96c7 Author: Jeremy Allison Date: Thu Aug 27 11:59:20 2020 -0700 s3: libsmb: Add internal conversion function ip_service_to_samba_sockaddr(). Compiles but commented out as not yet used. Next commit will change that. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 4c81f39012c5a1858161ba8f9a61393eb2ab3c9f Author: Jeremy Allison Date: Thu Aug 27 11:52:57 2020 -0700 s3: winbindd: Use namecache_store_sa() inside dcip_check_name(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 1593231e0ef0d36fad7779f2f22b40a284706b9b Author: Jeremy Allison Date: Thu Aug 27 11:49:07 2020 -0700 s3: libsmb: Use namecache_store_sa() instead of namecache_store(). Removes one more struct ip_service usage. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 0e59fee2917f0fbd9c2c8fc04d0161af486beb64 Author: Jeremy Allison Date: Thu Aug 27 11:45:17 2020 -0700 s3: libsmb: Add namecache_store_sa(). Doesn't store ports and takes a samba_sockaddr array. Now uses ipstr_list_make_sa(). Now convert the callers, remove namecache_store() and then rename namecache_store_sa() back to namecache_store(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 7835e2cb480d3749a3ebbd4ab69188743df5277b Author: Jeremy Allison Date: Thu Aug 27 11:40:10 2020 -0700 s3: libsmb: Add internal ipstr_list_make_sa(). Duplicates ipstr_list_make() with samba_sockaddr, but doesn't store ports. The duplication is temporary as the ipstr_list_make() function will go away once namecache_store is converted to samba_sockaddr. Compiles but commented out as not yet used. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power commit 39ecff712f0aa6f8c86c3dcad12b068d7b8ccdb7 Author: Jeremy Allison Date: Thu Aug 27 11:33:20 2020 -0700 s3: libsmb: Cleanup - re
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 9aa6b0cd2e1 libsmb: Fix CID 1465860 Control flow issues (DEADCODE) via f0860de5bb2 python compat: remove text_type via ace5038031f python compat: remove binary_type via bcaf076d30f python compat: reduce use of 'if PY3:' via 4d9d63b000d python compat: remove StringIO via 9cc65a552b0 python compat: remove string_types via 323073f4e0f python compat: remove integer_types from 32eb7f39667 Remove depracated "ldap ssl ads" smb.conf option https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 9aa6b0cd2e1936dd8ca68bbeec233fd42b89b98f Author: Volker Lendecke Date: Tue Aug 11 09:51:39 2020 +0200 libsmb: Fix CID 1465860 Control flow issues (DEADCODE) Signed-off-by: Volker Lendecke Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Aug 11 18:00:26 UTC 2020 on sn-devel-184 commit f0860de5bb2e12ad0f91f5428410ea0346286c1e Author: Douglas Bagnall Date: Sat Jul 4 14:27:06 2020 +1200 python compat: remove text_type Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit ace5038031f3b7f7017da2ad0076b9f8fca59d10 Author: Douglas Bagnall Date: Sat Jul 4 14:05:16 2020 +1200 python compat: remove binary_type Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit bcaf076d30f38cea4465be57d5270e9431951161 Author: Douglas Bagnall Date: Sat Jul 4 14:01:32 2020 +1200 python compat: reduce use of 'if PY3:' Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 4d9d63b000db28c3b718f7f1dbddac5a94685687 Author: Douglas Bagnall Date: Sat Jul 4 13:53:34 2020 +1200 python compat: remove StringIO Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 9cc65a552b0270db0ea08509ee6e9a3d5b9a1f10 Author: Douglas Bagnall Date: Sat Jul 4 13:47:44 2020 +1200 python compat: remove string_types Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 323073f4e0feadcaaf0978604741660b6ef02a16 Author: Douglas Bagnall Date: Sat Jul 4 13:44:52 2020 +1200 python compat: remove integer_types Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: buildtools/wafsamba/tests/test_abi.py | 2 +- python/samba/__init__.py | 5 ++--- python/samba/compat.py| 8 python/samba/gp_parse/gp_csv.py | 6 ++ python/samba/gp_parse/gp_ini.py | 2 +- python/samba/gpclass.py | 2 +- python/samba/join.py | 3 +-- python/samba/ms_schema.py | 7 +++ python/samba/netcmd/domain.py | 3 +-- python/samba/netcmd/user.py | 5 ++--- python/samba/netcmd/visualize.py | 3 +-- python/samba/provision/__init__.py| 8 +++- python/samba/samdb.py | 12 +--- python/samba/tests/__init__.py| 4 +--- python/samba/tests/auth_log_netlogon.py | 3 +-- python/samba/tests/auth_log_samlogon.py | 3 +-- python/samba/tests/blackbox/samba_dnsupdate.py| 2 +- python/samba/tests/credentials.py | 18 +- python/samba/tests/dcerpc/raw_protocol.py | 5 ++--- python/samba/tests/dcerpc/raw_testcase.py | 1 - python/samba/tests/dcerpc/testrpc.py | 3 +-- python/samba/tests/dcerpc/unix.py | 3 +-- python/samba/tests/dns_base.py| 7 +++ python/samba/tests/emulate/traffic.py | 2 +- python/samba/tests/messaging.py | 3 +-- python/samba/tests/netcmd.py | 2 +- python/samba/tests/password_hash.py | 3 +-- python/samba/tests/password_hash_ldap.py | 3 +-- python/samba/tests/samba_tool/base.py | 2 +- python/samba/tests/samba_tool/user_wdigest.py | 4 ++-- selftest/subunithelper.py | 3 +-- source3/libsmb/namequery.c| 2 +- source4/dsdb/tests/python/sam.py | 4 ++-- source4/dsdb/tests/python/sort.py | 3 +-- source4/scripting/bin/samba_dnsupdate | 3 +-- source4/scripting/devel/pfm_verify.py | 4 ++-- source4/torture/drs/python/samba_tool_drs_showrepl.py | 3 +-- 37 files changed, 56 insertions(+), 100 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafs
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6e496aa3635 nsswitch/nsstest.c: Avoid nss function conflicts with glibc nss.h from 642dc6ded64 ctdb-scripts: Use nfsconf as a last resort get nfsd thread count https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6e496aa3635557b59792e469f7c7f8eccd822322 Author: Khem Raj Date: Wed Jul 22 22:42:09 2020 -0700 nsswitch/nsstest.c: Avoid nss function conflicts with glibc nss.h glibc 2.32 will define these varibles [1] which results in conflicts with these static function names, therefore prefix these function names with samba_ to avoid it [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=499a92df8b9fc64a054cf3b7f728f8967fc1da7d Signed-off-by: Khem Raj Reviewed-by: Volker Lendecke Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jul 28 10:52:00 UTC 2020 on sn-devel-184 --- Summary of changes: nsswitch/nsstest.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/nsswitch/nsstest.c b/nsswitch/nsstest.c index e8c4306441d..e2ee9fbf3af 100644 --- a/nsswitch/nsstest.c +++ b/nsswitch/nsstest.c @@ -137,7 +137,7 @@ static struct passwd *nss_getpwuid(uid_t uid) return } -static void nss_setpwent(void) +static void samba_nss_setpwent(void) { NSS_STATUS (*_nss_setpwent)(void) = (NSS_STATUS(*)(void))find_fn("setpwent"); @@ -152,7 +152,7 @@ static void nss_setpwent(void) } } -static void nss_endpwent(void) +static void samba_nss_endpwent(void) { NSS_STATUS (*_nss_endpwent)(void) = (NSS_STATUS (*)(void))find_fn("endpwent"); @@ -290,7 +290,7 @@ again: return } -static void nss_setgrent(void) +static void samba_nss_setgrent(void) { NSS_STATUS (*_nss_setgrent)(void) = (NSS_STATUS (*)(void))find_fn("setgrent"); @@ -305,7 +305,7 @@ static void nss_setgrent(void) } } -static void nss_endgrent(void) +static void samba_nss_endgrent(void) { NSS_STATUS (*_nss_endgrent)(void) = (NSS_STATUS (*)(void))find_fn("endgrent"); @@ -402,7 +402,7 @@ static void nss_test_users(void) { struct passwd *pwd; - nss_setpwent(); + samba_nss_setpwent(); /* loop over all users */ while ((pwd = nss_getpwent())) { printf("Testing user %s\n", pwd->pw_name); @@ -424,14 +424,14 @@ static void nss_test_users(void) printf("initgroups: "); nss_test_initgroups(pwd->pw_name, pwd->pw_gid); printf("\n"); } - nss_endpwent(); + samba_nss_endpwent(); } static void nss_test_groups(void) { struct group *grp; - nss_setgrent(); + samba_nss_setgrent(); /* loop over all groups */ while ((grp = nss_getgrent())) { printf("Testing group %s\n", grp->gr_name); @@ -452,7 +452,7 @@ static void nss_test_groups(void) printf("getgrgid: "); print_group(grp); printf("\n"); } - nss_endgrent(); + samba_nss_endgrent(); } static void nss_test_errors(void) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 34f8ab774d1 s3/librpc/crypto: Fix double free with unresolved credential cache from 5e987e2f40e s3: VFS: Add cmocka test for vfs_full_audit to make sure all arrays are correct. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 34f8ab774d1484b0e60dbdec8ad2a1607ad92122 Author: Noel Power Date: Tue Apr 14 11:21:22 2020 +0100 s3/librpc/crypto: Fix double free with unresolved credential cache We free gse_ctx->k5ctx but then free it again in the talloc dtor. This patch just lets the talloc dtor handle things and removes the extra krb5_free_context Failed to resolve credential cache 'DIR:/run/user/1000/krb5cc'! (No credentials cache found) ==30762== Invalid read of size 8 ==30762==at 0x108100F4: k5_os_free_context (in /usr/lib64/libkrb5.so.3.3) ==30762==by 0x107EA661: krb5_free_context (in /usr/lib64/libkrb5.so.3.3) ==30762==by 0x7945D2E: gse_context_destructor (gse.c:84) ==30762==by 0x645FB49: _tc_free_internal (talloc.c:1157) ==30762==by 0x645FEC5: _talloc_free_internal (talloc.c:1247) ==30762==by 0x646118D: _talloc_free (talloc.c:1789) ==30762==by 0x79462E4: gse_context_init (gse.c:241) ==30762==by 0x794636E: gse_init_client (gse.c:268) ==30762==by 0x7947602: gensec_gse_client_start (gse.c:786) ==30762==by 0xBC87A3A: gensec_start_mech (gensec_start.c:743) ==30762==by 0xBC87BC6: gensec_start_mech_by_ops (gensec_start.c:774) ==30762==by 0xBC8167F: gensec_spnego_client_negTokenInit_step (spnego.c:633) ==30762== Address 0x17259928 is 40 bytes inside a block of size 496 free'd ==30762==at 0x4C2F50B: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==30762==by 0x79462CA: gse_context_init (gse.c:238) ==30762==by 0x794636E: gse_init_client (gse.c:268) ==30762==by 0x7947602: gensec_gse_client_start (gse.c:786) ==30762==by 0xBC87A3A: gensec_start_mech (gensec_start.c:743) ==30762==by 0xBC87BC6: gensec_start_mech_by_ops (gensec_start.c:774) ==30762==by 0xBC8167F: gensec_spnego_client_negTokenInit_step (spnego.c:633) ==30762==by 0xBC813E2: gensec_spnego_client_negTokenInit_start (spnego.c:537) ==30762==by 0xBC84084: gensec_spnego_update_pre (spnego.c:1943) ==30762==by 0xBC83AE5: gensec_spnego_update_send (spnego.c:1741) ==30762==by 0xBC85622: gensec_update_send (gensec.c:449) ==30762==by 0x551BFD0: cli_session_setup_gensec_local_next (cliconnect.c:997) ==30762== Block was alloc'd at ==30762==at 0x4C306B5: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==30762==by 0x107EA7AE: krb5_init_context_profile (in /usr/lib64/libkrb5.so.3.3) ==30762==by 0xB853215: smb_krb5_init_context_common (krb5_samba.c:3597) ==30762==by 0x794615B: gse_context_init (gse.c:209) ==30762==by 0x794636E: gse_init_client (gse.c:268) ==30762==by 0x7947602: gensec_gse_client_start (gse.c:786) ==30762==by 0xBC87A3A: gensec_start_mech (gensec_start.c:743) ==30762==by 0xBC87BC6: gensec_start_mech_by_ops (gensec_start.c:774) ==30762==by 0xBC8167F: gensec_spnego_client_negTokenInit_step (spnego.c:633) ==30762==by 0xBC813E2: gensec_spnego_client_negTokenInit_start (spnego.c:537) ==30762==by 0xBC84084: gensec_spnego_update_pre (spnego.c:1943) ==30762==by 0xBC83AE5: gensec_spnego_update_send (spnego.c:1741) ==30762== BUG: https://bugzilla.samba.org/show_bug.cgi?id=14344 Signed-off-by: Noel Power Reviewed-by: Volker Lendecke Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Apr 14 22:55:51 UTC 2020 on sn-devel-184 --- Summary of changes: source3/librpc/crypto/gse.c | 4 1 file changed, 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/librpc/crypto/gse.c b/source3/librpc/crypto/gse.c index 6675f4dc597..1cf111bd974 100644 --- a/source3/librpc/crypto/gse.c +++ b/source3/librpc/crypto/gse.c @@ -244,10 +244,6 @@ static NTSTATUS gse_context_init(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; err_out: - if (gse_ctx->k5ctx) { - krb5_free_context(gse_ctx->k5ctx); - } - TALLOC_FREE(gse_ctx); return status; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 8cad448ab24 selftest/flapping: mark samba3.nbt.dgram.netlogon.* as flapping from 78e1492f218 smbd: move files_struct.lock_failure_seen to a bitfield https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 8cad448ab24bb0290c52405ea5d1ae22a759f587 Author: Noel Power Date: Fri Apr 3 16:05:37 2020 +0100 selftest/flapping: mark samba3.nbt.dgram.netlogon.* as flapping Post SMB1/SMB2 test env split to help in removing smb1 samba3.nbt.dgram.netlogon* fails randomly. It is unrelated as far as we can see to the changes but must be a side affect of runtime order or some such. Signed-off-by: Noel Power Reviewed-by: Ralph Boehme Autobuild-User(master): Noel Power Autobuild-Date(master): Sat Apr 4 01:12:05 UTC 2020 on sn-devel-184 --- Summary of changes: selftest/flapping.d/nbt_dgram | 7 +++ 1 file changed, 7 insertions(+) create mode 100644 selftest/flapping.d/nbt_dgram Changeset truncated at 500 lines: diff --git a/selftest/flapping.d/nbt_dgram b/selftest/flapping.d/nbt_dgram new file mode 100644 index 000..b4e4c3b4ac8 --- /dev/null +++ b/selftest/flapping.d/nbt_dgram @@ -0,0 +1,7 @@ +# following SMB1/SMB2 test env split it seems this test +# fails randomly however it doesn't seem to be directly +# related to the changes (e.g. not protocl negotiation +# specific) Best guess is the order of test having being +# changed (as a result of test moving env) or some other +# strange env related side affect is causing this. +^samba3.nbt.dgram.netlogon.*\(ad_dc\) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 24b03fd28ed s3/utils: Fix double free error with smbtree from 2558c15beb0 s3:rpc_server: Fix talloc_free() with references error on server exit https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 24b03fd28ed19cea8f875f96b3e300f808dfc4ae Author: Noel Power Date: Wed Apr 1 12:26:09 2020 +0100 s3/utils: Fix double free error with smbtree ==3632== WORKGROUP \\ATP \\ATP\IPC$ IPC Service () ==3632== Invalid read of size 8 ==3632==at 0x773C926: poptResetContext (in /usr/lib64/libpopt.so.0.0.0) ==3632==by 0x773E5DD: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0) ==3632==by 0x10A8BC: main (smbtree.c:354) ==3632== Address 0x16085e00 is 640 bytes inside a block of size 784 free'd ==3632==at 0x4C2F1AD: free (vg_replace_malloc.c:530) ==3632==by 0x773E6F7: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0) ==3632==by 0x10A84B: main (smbtree.c:342) ==3632== Block was alloc'd at ==3632==at 0x4C2FE45: calloc (vg_replace_malloc.c:711) ==3632==by 0x773C79A: poptGetContext (in /usr/lib64/libpopt.so.0.0.0) ==3632==by 0x10A829: main (smbtree.c:339) ==3632== BUG: https://bugzilla.samba.org/show_bug.cgi?id=14332 Signed-off-by: Noel Power Reviewed-by: Volker Lendecke Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Apr 1 18:51:43 UTC 2020 on sn-devel-184 --- Summary of changes: source3/utils/smbtree.c | 1 - 1 file changed, 1 deletion(-) Changeset truncated at 500 lines: diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c index 8e4caf0e80b..626279a96fd 100644 --- a/source3/utils/smbtree.c +++ b/source3/utils/smbtree.c @@ -339,7 +339,6 @@ int main(int argc, char *argv[]) pc = poptGetContext("smbtree", argc, argv_const, long_options, POPT_CONTEXT_KEEP_FIRST); while(poptGetNextOpt(pc) != -1); - poptFreeContext(pc); popt_burn_cmdline_password(argc, argv); /* Now do our stuff */ -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1114b02a72c s3: libsmbclient.h: add missing time.h include via 4d65e3ad210 s4-librpc: Simplify bytes or unicode input checking in python GUID() bindings via a7633deb897 py3: Remove #define IsPy3BytesOrString(pystr) via 675ab9d6ae6 py3: Remove #define IsPy3Bytes PyBytes_Check via 5c1867ba459 py3: Remove #define PyInt_FromLong PyLong_FromLong via 4764e8b4c7e py3: Remove #define PyInt_AsLong PyLong_AsLong via cc79726d951 py3: Remove #define PyInt_Type PyLong_Type via 08a76ec0963 pidl: Remove reference to PyInt_Type from error string when we wanted a sensible Long via 79044e966cb pidl: Remove duplicate "if (PyLong_Check($cvar)" clauses via 3aea3b15381 py3: Remove #define PyInt_Check PyLong_Check from 9bdc5a67428 autobuild: Merge samba-simpleserver into samba-nt4 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1114b02a72ce0c86a5301816560d270ec47f8be3 Author: Aurelien Aptel Date: Fri Mar 13 13:42:53 2020 +0100 s3: libsmbclient.h: add missing time.h include A recent change added a struct with timespec members in the public libsmbclient header. This type is defined in time.h which was not included thus making users of libsmbclient not build properly. /.../libsmbclient.h:158:18: error: field 'btime_ts' has incomplete type struct timespec btime_ts; Fixes: bf13fe0f222 ("s3: libsmbclient: Add internal/external structures needed for readdirplus.") Signed-off-by: Aurelien Aptel Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Mar 23 20:47:44 UTC 2020 on sn-devel-184 commit 4d65e3ad2104773b361afd35d3b8b8b7e598f91f Author: Andrew Bartlett Date: Sun Mar 15 10:47:32 2020 +1300 s4-librpc: Simplify bytes or unicode input checking in python GUID() bindings Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit a7633deb8978e2417430692223047283baf30147 Author: Andrew Bartlett Date: Sun Mar 15 10:43:16 2020 +1300 py3: Remove #define IsPy3BytesOrString(pystr) This was (PyUnicode_Check(pystr) || PyBytes_Check(pystr)) This allows us to end the use of Python 2/3 compatability macros. The one caller will be simplified in the next commit Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 675ab9d6ae6f5cd95ddde51d19774cae7ecc11ca Author: Andrew Bartlett Date: Sun Mar 15 10:40:46 2020 +1300 py3: Remove #define IsPy3Bytes PyBytes_Check This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 5c1867ba459c2eff0dfc99c92200aecc2d44df59 Author: Andrew Bartlett Date: Sun Mar 15 10:36:59 2020 +1300 py3: Remove #define PyInt_FromLong PyLong_FromLong This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 4764e8b4c7e459f6aa5861d26ffaec3a3026d77f Author: Andrew Bartlett Date: Sun Mar 15 10:32:11 2020 +1300 py3: Remove #define PyInt_AsLong PyLong_AsLong This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit cc79726d95108e3d8ef612a863c2f9fffd768636 Author: Andrew Bartlett Date: Sun Mar 15 10:26:22 2020 +1300 py3: Remove #define PyInt_Type PyLong_Type This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 08a76ec0963049e0f2b8f855ab66ba5141472fce Author: Andrew Bartlett Date: Sun Mar 15 10:15:15 2020 +1300 pidl: Remove reference to PyInt_Type from error string when we wanted a sensible Long PyInt_Type is no longer a thing in Python3, we will remove the compatability reference shortly. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 79044e966cbe44d60997ecbd4b44f07305d99ac2 Author: Andrew Bartlett Date: Sun Mar 15 10:10:24 2020 +1300 pidl: Remove duplicate "if (PyLong_Check($cvar)" clauses Since we moved to Python3, these have been dead code, and it is clearer now that we have removed the compatability define. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 3aea3b15381857bf3e9a69477c487c91f1b6cbbd Author: Andrew Bartlett Date: Sun Mar 15 10:04:52 2020 +1300 py3: Remove #define PyInt_Check PyLong_Check This will allow us to remove some unused code in the PIDL-generated python bindings. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power --- Summary of changes: au
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via beb829d0e64 samba-tool gpo: tighter matching for ini names via 07fa6678e43 python: use raw string for regex with escape via c247afbda00 pytests: heed assertEquals deprecation warning en-masse from 3bc7acc6264 nmblib: avoid undefined behaviour in handle_name_ptrs() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit beb829d0e6477f4f82758b2d646c3e21634c768d Author: Douglas Bagnall Date: Fri Feb 7 11:27:32 2020 +1300 samba-tool gpo: tighter matching for ini names Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Feb 7 12:03:34 UTC 2020 on sn-devel-184 commit 07fa6678e43aa899472ac7c4f61960fabd326531 Author: Douglas Bagnall Date: Fri Feb 7 11:25:27 2020 +1300 python: use raw string for regex with escape Python regards 'GPT\.INI$' as a string containing an invalid escape sequence '\.', which is ignored (i.e. treated as the literal sequence of those 2 characters), but only after Python has grumbled to itself, and to you if you enabled DeprecationWarnings. The proper thing to do here is use r-strings, like r'GPT\.INI$', which tell Python that all backslashes are literal. Alternatively (as we do once in this patch), the backslash can itself be escaped ('\\'). There are more problems of this nature in the build scripts. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit c247afbda00013bf4821e5a2d4f3166bf31814f0 Author: Douglas Bagnall Date: Fri Feb 7 11:02:38 2020 +1300 pytests: heed assertEquals deprecation warning en-masse TestCase.assertEquals() is an alias for TestCase.assertEqual() and has been deprecated since Python 2.7. When we run our tests with in python developer mode (`PYTHONDEVMODE=1 make test`) we get 580 DeprecationWarnings about this. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: auth/credentials/tests/bind.py |6 +- buildtools/wafsamba/tests/test_abi.py | 20 +- buildtools/wafsamba/tests/test_bundled.py |2 +- buildtools/wafsamba/tests/test_utils.py| 28 +- lib/ldb-samba/tests/match_rules.py | 38 +- python/samba/gp_parse/gp_inf.py|2 +- python/samba/netcmd/drs.py |2 +- python/samba/netcmd/dsacl.py |4 +- python/samba/netcmd/gpo.py | 20 +- python/samba/netcmd/ldapcmp.py |6 +- python/samba/tests/__init__.py |2 +- python/samba/tests/audit_log_dsdb.py | 222 +-- python/samba/tests/audit_log_pass_change.py| 94 +- python/samba/tests/auth_log.py | 350 ++--- python/samba/tests/auth_log_ncalrpc.py | 22 +- python/samba/tests/auth_log_netlogon.py| 24 +- python/samba/tests/auth_log_netlogon_bad_creds.py | 10 +- python/samba/tests/auth_log_pass_change.py |6 +- python/samba/tests/auth_log_samlogon.py| 10 +- python/samba/tests/auth_log_winbind.py | 166 +-- python/samba/tests/blackbox/mdfind.py |2 +- python/samba/tests/blackbox/traffic_learner.py |8 +- python/samba/tests/blackbox/traffic_summary.py |2 +- python/samba/tests/common.py | 24 +- python/samba/tests/core.py | 16 +- python/samba/tests/dcerpc/bare.py | 12 +- python/samba/tests/dcerpc/dnsserver.py | 36 +- python/samba/tests/dcerpc/integer.py | 22 +- python/samba/tests/dcerpc/mdssvc.py|2 +- python/samba/tests/dcerpc/misc.py | 18 +- python/samba/tests/dcerpc/raw_protocol.py | 1504 ++-- python/samba/tests/dcerpc/raw_testcase.py | 134 +- python/samba/tests/dcerpc/registry.py |4 +- python/samba/tests/dcerpc/rpc_talloc.py|2 +- python/samba/tests/dcerpc/rpcecho.py | 20 +- python/samba/tests/dcerpc/sam.py | 108 +- python/samba/tests/dcerpc/unix.py |4 +- python/samba/tests/dns.py | 110 +- python/samba/tests/dns_base.py | 12 +- python/samba/tests/dns_forwarder.py|4 +- python/samba/tests/dns_tkey.py |8 +- python/samba/tests/dns_wildcard.py | 48 +- python/samba/tests/dsdb.py | 10 +- python/samba/tests/dsdb_schema_attributes.py | 52 +- python/samba/tests
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1bb16ff4e2d s4:torture: Convert samba4.base.charset test to smb2 from 3f0e0ee274f selftest: Exit skipped daemons on close(STDIN) https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1bb16ff4e2dc6ae5fe9461c622fcb2bc9ad6a851 Author: David Mulder Date: Tue Dec 10 12:06:13 2019 -0700 s4:torture: Convert samba4.base.charset test to smb2 The partial surrogate test is known to fail (in both smb1 and smb2). Signed-off-by: David Mulder Signed-off-by: Noel Power Reviewed-by: Ralph Böhme Reviewed-by: Jeremy Allison Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Jan 30 12:05:13 UTC 2020 on sn-devel-184 --- Summary of changes: selftest/knownfail | 2 + source4/torture/smb2/charset.c | 235 + source4/torture/smb2/smb2.c| 1 + source4/torture/smb2/wscript_build | 1 + 4 files changed, 239 insertions(+) create mode 100644 source4/torture/smb2/charset.c Changeset truncated at 500 lines: diff --git a/selftest/knownfail b/selftest/knownfail index c9ef0851172..c78c716beb2 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -106,6 +106,8 @@ ^samba4.rpc.samr.passwords.validate.*ncacn_ip_tcp.*with.validate # should only work with seal ^samba4.rpc.samr.passwords.validate.*ncacn_ip_tcp.*with.bigendian # should only work with seal ^samba4.base.charset.*.Testing partial surrogate +^samba4.smb2.charset.*.Testing partial surrogate # This test is currently broken +^samba3.smb2.charset.*.Testing partial surrogate # This test is currently broken ^samba4.*.base.maximum_allowed # broken until we implement NTCREATEX_OPTIONS_BACKUP_INTENT .*net.api.delshare.* # DelShare isn't implemented yet ^samba4.smb2.oplock.doc diff --git a/source4/torture/smb2/charset.c b/source4/torture/smb2/charset.c new file mode 100644 index 000..a385266886b --- /dev/null +++ b/source4/torture/smb2/charset.c @@ -0,0 +1,235 @@ +/* + Unix SMB/CIFS implementation. + + SMB torture tester - charset test routines + + Copyright (C) Andrew Tridgell 2001 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "includes.h" +#include "libcli/smb2/smb2.h" +#include "libcli/smb2/smb2_calls.h" +#include "torture/torture.h" +#include "torture/smb2/proto.h" +#include "libcli/libcli.h" +#include "torture/util.h" +#include "param/param.h" + +#define BASEDIR "chartest" + +/* + open a file using a set of unicode code points for the name + + the prefix BASEDIR is added before the name +*/ +static NTSTATUS unicode_open(struct torture_context *tctx, +struct smb2_tree *tree, +TALLOC_CTX *mem_ctx, +uint32_t create_disposition, +const uint32_t *u_name, +size_t u_name_len) +{ + struct smb2_create io = {0}; + char *fname = NULL; + char *fname2 = NULL; + char *ucs_name = NULL; + size_t i; + NTSTATUS status; + + ucs_name = talloc_size(mem_ctx, (1+u_name_len)*2); + if (!ucs_name) { + torture_comment(tctx, "Failed to create UCS2 Name - talloc() failure\n"); + return NT_STATUS_NO_MEMORY; + } + + for (i=0;ilp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **), )) { + torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n"); + talloc_free(ucs_name); + return NT_STATUS_NO_MEMORY; + } + + fname2 = talloc_asprintf(ucs_name, "%s\\%s", BASEDIR, fname); + if (!fname2) { + talloc_free(ucs_name); + torture_comment(tctx, "Failed to create fname - talloc() failure\n"); + return NT_STATUS_NO_MEMORY; + } + + io.in.create_flags = NTCREATEX_FLAGS_EXTENDED; + io.in.desired_access = SEC_RIGHTS_FILE_ALL; + io.in.file_attributes = FILE_ATTRIBU
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f38077ea5ee pidl: Handle obtaining objects from a fixed-size array via 1261894ecae pidl/python: allocate objects with ref pointers via 7e19779b66d pytests/segfault: pidl inline arrays via 272e20adbbb pytests/segfaults: dcerpc ref elements segfault via 4dd725b1b59 pytests: rpc echo should not segfault via 220cf67776f s4/rpc/dcerpc_connect: no crash on NULL dest_host from 963a639101f ctdb-tests: Add tests for cmdline_add() api https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f38077ea5ee0a8d3d18970e3e183c3ee516fa121 Author: Andrew Bartlett Date: Tue Oct 29 21:19:05 2019 + pidl: Handle obtaining objects from a fixed-size array Previously we would assume the array head was the talloc context however this is not the case if the array is a fixed size inline array within the parent struct. In that case the overall object's talloc context is the correct context to reference. Signed-off-by: Andrew Bartlett Pair-programmed-with: Douglas Bagnall Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Nov 14 17:36:49 UTC 2019 on sn-devel-184 commit 1261894ecaebc1a3340c42e818be25caa69f6364 Author: Douglas Bagnall Date: Tue Oct 29 11:58:32 2019 +1300 pidl/python: allocate objects with ref pointers Struct members that are marked as ref pointers need to have an object allocated for them. Signed-off-by: Douglas Bagnall Pair-programmed-with: Andrew Bartlett Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 7e19779b66d7329e4208eaa5801cec0b6feb3754 Author: Douglas Bagnall Date: Tue Oct 29 22:11:41 2019 + pytests/segfault: pidl inline arrays Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 272e20adbbbaebd7bbf94c79f44f1ff42d2831d8 Author: Douglas Bagnall Date: Tue Oct 29 12:02:04 2019 +1300 pytests/segfaults: dcerpc ref elements segfault These are just a couple of examples. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 4dd725b1b599968fb787c93f6eb3a42af007b21c Author: Douglas Bagnall Date: Thu Oct 24 10:41:28 2019 +1300 pytests: rpc echo should not segfault Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 220cf67776f16467488805ecd6d1905c708eaa17 Author: Douglas Bagnall Date: Wed Jul 24 17:50:35 2019 +1200 s4/rpc/dcerpc_connect: no crash on NULL dest_host Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: pidl/lib/Parse/Pidl/Samba4/Python.pm | 63 ++-- python/samba/tests/segfault.py | 24 +- source4/librpc/rpc/dcerpc_connect.c | 2 +- 3 files changed, 85 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 8d5de31e7bb..161521c6e3a 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -499,7 +499,62 @@ sub PythonFunctionStruct() $self->pidl("static PyObject *py_$name\_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)"); $self->pidl("{"); $self->indent; - $self->pidl("return pytalloc_new($cname, type);"); + + # This creates a new, zeroed C structure and python object. + # Thse may not be valid or sensible values, but this is as + # well as we can do. + + $self->pidl("PyObject *self = pytalloc_new($cname, type);"); + + # If there are any children that are ref pointers, we need to + # allocate something for them to point to just as the pull + # routine will when parsing the stucture from NDR. + # + # We then make those pointers point to zeroed memory + # + # A ref pointer is a pointer in the C structure but a scalar + # on the wire. It is for a remote function like: + # + # int foo(int *i) + # + # This may be called with the pointer by reference eg foo() + # + # That is why this only goes as far as the next level; deeply + # nested pointer chains will end in a NULL. + + my @ref_elements; + foreach my $e (@{$fn->{ELEMENTS}}) { + if (has_property($e, "ref") && ! has_property($e, "charset")) { + if (!has_property($e, 'in') && !has_property($e, 'out')) { + die "ref pointer that is not in or out"; + } + push @ref_elements, $e; +
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 30e8f513a8b Detect when command line max protocol < min protocol from 6cf443ab1f9 s4-libcli: Remove unused header from composite/composite.c https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 30e8f513a8bae58d7d4e88fad8f8d5497076c553 Author: David Mulder Date: Fri Nov 8 17:10:47 2019 + 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 Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Nov 12 17:52:28 UTC 2019 on sn-devel-184 --- Summary of changes: lib/param/loadparm.c | 14 ++ lib/param/param_table.c | 11 +++ source3/param/loadparm.c | 14 ++ 3 files changed, 39 insertions(+) Changeset truncated at 500 lines: diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 9a577aa188c..5334e9c4e5d 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -3117,6 +3117,7 @@ const char *lp_default_path(void) static bool lpcfg_update(struct loadparm_context *lp_ctx) { struct debug_settings settings; + int max_protocol, min_protocol; TALLOC_CTX *tmp_ctx; tmp_ctx = talloc_new(lp_ctx); @@ -3160,6 +3161,19 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx) unsetenv("SOCKET_TESTNONBLOCK"); } + /* Check if command line max protocol < min protocol, if so +* report a warning to the user. +*/ + max_protocol = lpcfg_client_max_protocol(lp_ctx); + min_protocol = lpcfg_client_min_protocol(lp_ctx); + if (lpcfg_client_max_protocol(lp_ctx) < lpcfg_client_min_protocol(lp_ctx)) { + const char *max_protocolp, *min_protocolp; + max_protocolp = lpcfg_get_smb_protocol(max_protocol); + min_protocolp = lpcfg_get_smb_protocol(min_protocol); + DBG_ERR("Max protocol %s is less than min protocol %s.\n", + max_protocolp, min_protocolp); + } + TALLOC_FREE(tmp_ctx); return true; } diff --git a/lib/param/param_table.c b/lib/param/param_table.c index 2fd3361f996..47b85de1f87 100644 --- a/lib/param/param_table.c +++ b/lib/param/param_table.c @@ -61,6 +61,17 @@ static const struct enum_list enum_protocol[] = { {-1, NULL} }; +const char* lpcfg_get_smb_protocol(int type) +{ + int i; + for (i = 1; enum_protocol[i].value != -1; i++) { + if (enum_protocol[i].value == type) { + return enum_protocol[i].name; + } + } + return NULL; +} + static const struct enum_list enum_security[] = { {SEC_AUTO, "AUTO"}, {SEC_USER, "USER"}, diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b1a52055ade..433762eedfb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3861,6 +3861,7 @@ static bool lp_load_ex(const char *pszFname, bool bRetval; TALLOC_CTX *frame = talloc_stackframe(); struct loadparm_context *lp_ctx; + int max_protocol, min_protocol; DEBUG(3, ("lp_load_ex: refreshing parameters\n")); @@ -3999,6 +4000,19 @@ static bool lp_load_ex(const char *pszFname, bAllowIncludeRegistry = true; + /* Check if command line max protocol < min protocol, if so +* report a warning to the user. +*/ + max_protocol = lp_client_max_protocol(); + min_protocol = lp_client_min_protocol(); + if (max_protocol < min_protocol) { + const char *max_protocolp, *min_protocolp; + max_protocolp = lpcfg_get_smb_protocol(max_protocol); + min_protocolp = lpcfg_get_smb_protocol(min_protocol); + DBG_ERR("Max protocol %s is less than min protocol %s.\n", + max_protocolp, min_protocolp); + } + TALLOC_FREE(frame); return (bRetval); } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 3bb7ccb4635 s4:scripting: make samba-gpupdate heed --disable-python via 018c93f35a8 s3/librpc/crypto: clang: Fixes Value stored to 'ret' is never read via 40ddcf7bdce s3/libads: clang: Fix Array access results in a null pointer dereference via d3371d8545b s3/librpc/crypto: clang: warning: Value stored to 'gss_maj' is never read via f755de54135 s4/libcli/clideltree.c: clang: Value stored to 'status' is never read via ba55c022076 s4/libcli/smb2: clang: Fix 'value stored to 'status' is never read' via 076216da796 s4/libcli/smb2: clang: Fix Passed-by-value arg contains uninitialized data via 088a345f6ac s4/libcli/raw: clang: Fix 'Value stored to 'p' is never read' via a1a448b19b9 s4/libcli/raw: clang: Fix 'Dereference of null pointer' via 55c6e4bcc1b s4/libcli/raw: clang: Fix 'Access to field results in a deref of a null ptr from 517ec63004f vfs_fileid: add "fsname_norootdir_ext" option https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 3bb7ccb4635535cb9dd9333220222dcfffb2aed9 Author: Philipp Gesang Date: Thu Sep 19 09:03:45 2019 +0200 s4:scripting: make samba-gpupdate heed --disable-python Signed-off-by: Philipp Gesang Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Sep 25 11:06:04 UTC 2019 on sn-devel-184 commit 018c93f35a80daef74e44e32ff0ff7437eed8547 Author: Noel Power Date: Thu Aug 8 13:15:14 2019 + s3/librpc/crypto: clang: Fixes Value stored to 'ret' is never read Fixes: source3/librpc/crypto/gse_krb5.c:63:3: warning: Value stored to 'ret' is never read <--[clang] ret = smb_krb5_kt_free_entry(krbctx, _entry); ^ ~ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit 40ddcf7bdcec547acdba090f43651cc5b953aded Author: Noel Power Date: Thu Aug 8 13:12:39 2019 + s3/libads: clang: Fix Array access results in a null pointer dereference Fixes: source3/libads/cldap.c:400:6: warning: Array access (from variable 'responses') results in a null pointer dereference <--[clang] if (responses[0] == NULL) { ^ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit d3371d8545bb4303e866e991453a0bbb05dd7656 Author: Noel Power Date: Fri Aug 2 10:45:48 2019 + s3/librpc/crypto: clang: warning: Value stored to 'gss_maj' is never read Fixes: Value stored to 'gss_maj' is never read source3/librpc/crypto/gse.c:562:3: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer(_min, _data); ^ ~~~ source3/librpc/crypto/gse.c:687:3: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer(_min, _data); ^ ~~~ source3/librpc/crypto/gse.c:739:3: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer(_min, _min); ^ ~~ source3/librpc/crypto/gse.c:742:3: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer(_min, _maj); ^ ~~ 4 warnings generated. Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit f755de54135ab5900209d093a45d9b824687a3bf Author: Noel Power Date: Thu Aug 8 15:10:30 2019 +0100 s4/libcli/clideltree.c: clang: Value stored to 'status' is never read Fixes: source4/libcli/clideltree.c:113:3: warning: Value stored to 'status' is never read <--[clang] status = smbcli_setatr(tree, dname, FILE_ATTRIBUTE_NORMAL, 0); ^ source4/libcli/clideltree.c:131:3: warning: Value stored to 'status' is never read <--[clang] status = smbcli_setatr(dstate.tree, dname, FILE_ATTRIBUTE_NORMAL, 0); ^ ~~~ 2 warnings generated. Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit ba55c0220767358656be125e6cecedef97317e9f Author: Noel Power Date: Mon Jul 29 11:44:26 2019 + s4/libcli/smb2: clang: Fix 'value stored to 'status' is never read' Fixes: source4/libcli/smb2/util.c:134:3: warning: Value stored to
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d51bb3137fa whitespace: Conform to coding convention via a0fe965c362 param: Allow rpc server dynamic port range to roundtrip from b730f350c22 s4:torture: fix file cleanup in smb2.create.delete https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d51bb3137fad727baa487c4210ac4d5020bf7a1e Author: Garming Sam Date: Wed Sep 11 13:58:48 2019 +1200 whitespace: Conform to coding convention Signed-off-by: Garming Sam Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Sep 13 12:33:32 UTC 2019 on sn-devel-184 commit a0fe965c36218c5992ed2a6fe7c7fdb00b420702 Author: Garming Sam Date: Wed Sep 11 13:55:37 2019 +1200 param: Allow rpc server dynamic port range to roundtrip Originally this parameter only set two other parameters, but never set the original string. By setting the string as well, we can make it be emitted by testparm -v correctly (instead of ''), and set it back as the value for the parameter. Signed-off-by: Garming Sam Reviewed-by: Noel Power --- Summary of changes: lib/param/loadparm.c | 16 +++- python/samba/tests/docs.py | 2 -- 2 files changed, 15 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 97addf45470..9a577aa188c 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -1445,7 +1445,7 @@ bool handle_smb_ports(struct loadparm_context *lp_ctx, struct loadparm_service * } } - if(!set_variable_helper(lp_ctx->globals->ctx, parm_num, ptr, "smb ports", + if (!set_variable_helper(lp_ctx->globals->ctx, parm_num, ptr, "smb ports", pszParmValue)) { return false; } @@ -1474,9 +1474,17 @@ bool handle_rpc_server_dynamic_port_range(struct loadparm_context *lp_ctx, const char *pszParmValue, char **ptr) { + static int parm_num = -1; int low_port = -1, high_port = -1; int rc; + if (parm_num == -1) { + parm_num = lpcfg_map_parameter("rpc server dynamic port range"); + if (parm_num == -1) { + return false; + } + } + if (pszParmValue == NULL || pszParmValue[0] == '\0') { return false; } @@ -1494,6 +1502,12 @@ bool handle_rpc_server_dynamic_port_range(struct loadparm_context *lp_ctx, return false; } + if (!set_variable_helper(lp_ctx->globals->ctx, parm_num, ptr, +"rpc server dynamic port range", +pszParmValue)) { + return false; + } + lp_ctx->globals->rpc_low_port = low_port; lp_ctx->globals->rpc_high_port = high_port; diff --git a/python/samba/tests/docs.py b/python/samba/tests/docs.py index b6c15b7d8de..32a16a98fbc 100644 --- a/python/samba/tests/docs.py +++ b/python/samba/tests/docs.py @@ -123,7 +123,6 @@ class SmbDotConfTests(TestCase): 'template homedir', 'max open files', 'include system krb5 conf', -'rpc server dynamic port range', 'mit kdc command', 'smbd max async dosmode', ]) @@ -247,7 +246,6 @@ class SmbDotConfTests(TestCase): exceptions = set([ 'printing', -'rpc server dynamic port range', 'smbd max async dosmode', ]) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 9173ae5f7f0 s3/lib/ctdbd_conn: assert hdr following read/recv from 123267138e9 tevent: Release tevent 0.10.1 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 9173ae5f7f02d2f1675d505ee3da7e62cceeafd0 Author: David Disseldorp Date: Tue Sep 3 15:26:19 2019 +0200 s3/lib/ctdbd_conn: assert hdr following read/recv ctdb_pkt_recv_recv() and ctdb_read_packet() give us a non-null hdr on success, so drop the error path check in favour of an assert. This fixes a regression in 3913b9a4088b83d6ed7f94d136a26ecfa7e16b35, where tevent_req_error() may be skipped in the ctdbd_parse_done() ctdb_pkt_recv_recv() error path. Reported-by: Stefan Metzmacher Signed-off-by: David Disseldorp Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Sep 4 14:20:16 UTC 2019 on sn-devel-184 --- Summary of changes: source3/lib/ctdbd_conn.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 8a8fbec4552..843e57287b6 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -404,11 +404,12 @@ static int ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid, next_pkt: ret = ctdb_read_packet(conn->fd, conn->timeout, mem_ctx, ); - if (hdr == NULL || ret != 0) { + if (ret != 0) { DBG_ERR("ctdb_read_packet failed: %s\n", strerror(ret)); cluster_fatal("failed to read data from ctdbd\n"); return -1; } + SMB_ASSERT(hdr != NULL); DEBUG(11, ("Received ctdb packet\n")); ctdb_packet_dump(hdr); @@ -605,6 +606,7 @@ void ctdbd_socket_readable(struct tevent_context *ev, DBG_ERR("ctdb_read_packet failed: %s\n", strerror(ret)); cluster_fatal("failed to read data from ctdbd\n"); } + SMB_ASSERT(hdr != NULL); ret = ctdb_handle_message(ev, conn, hdr); @@ -1086,6 +1088,7 @@ int ctdbd_traverse(struct ctdbd_connection *conn, uint32_t db_id, DBG_ERR("ctdb_read_packet failed: %s\n", strerror(ret)); cluster_fatal("failed to read data from ctdbd\n"); } + SMB_ASSERT(hdr != NULL); if (hdr->operation != CTDB_REQ_MESSAGE) { DEBUG(0, ("Got operation %u, expected a message\n", @@ -1946,10 +1949,11 @@ static void ctdbd_parse_done(struct tevent_req *subreq) ret = ctdb_pkt_recv_recv(subreq, state, ); TALLOC_FREE(subreq); - if ((hdr == NULL) || tevent_req_error(req, ret)) { + if (tevent_req_error(req, ret)) { DBG_ERR("ctdb_pkt_recv_recv returned %s\n", strerror(ret)); return; } + SMB_ASSERT(hdr != NULL); if (hdr->operation != CTDB_REPLY_CALL) { DBG_ERR("received invalid reply\n"); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fe9b12b2740 pidl/ndr/python: avoid memory errors in getsetters via d6a82edd19b s4/messaging/py: don't DECREF borrowed references via b136f153b83 ldb_dn: free dn components on explode failure from 5d4aa6e8670 s3:smbd: Fix sync dosmode fallback in async dosmode codepath https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fe9b12b274028a1310ac6c59cc56ac36bb40ef5e Author: Douglas Bagnall Date: Thu Aug 1 23:29:55 2019 + pidl/ndr/python: avoid memory errors in getsetters This: $ python3 -c'from samba.dcerpc import lsa; x = lsa.EnumAccounts(); x.in_handle' should not raise a MemoryError, which is very unfriendly given that 'x.in_handle' is just named, not called, as far as the user is concerned. Returning None is the proper thing. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Aug 6 18:17:11 UTC 2019 on sn-devel-184 commit d6a82edd19b82d99401a27dbc6fe10121142e431 Author: Douglas Bagnall Date: Thu Aug 1 16:02:05 2019 +1200 s4/messaging/py: don't DECREF borrowed references This made Message.deregister() a decref machine, with talloc crashes and segfaults available thus: from samba import messaging m = messaging.Messaging() for i in range(20): m.deregister(m) Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit b136f153b83d80a91ec9d5350fdf08412d881964 Author: Douglas Bagnall Date: Fri Mar 8 12:12:00 2019 +1300 ldb_dn: free dn components on explode failure Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: lib/ldb/common/ldb_dn.c | 2 +- pidl/lib/Parse/Pidl/Samba4/Python.pm | 8 source4/lib/messaging/pymessaging.c | 2 -- 3 files changed, 9 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c index eccb4a0ce4b..23a817edf65 100644 --- a/lib/ldb/common/ldb_dn.c +++ b/lib/ldb/common/ldb_dn.c @@ -340,7 +340,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn) /* Components data space is allocated here once */ data = talloc_array(dn->components, char, strlen(parse_dn) + 1); if (!data) { - return false; + goto failed; } p = parse_dn; diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 97c417adf35..8d5de31e7bb 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -201,6 +201,14 @@ sub PythonElementGetSet($$) { $self->indent; $self->pidl("$cname *object = ($cname *)pytalloc_get_ptr(obj);"); $self->pidl("PyObject *py_$e->{NAME};"); + my $l = $e->{LEVELS}[0]; + if ($l->{TYPE} eq "POINTER") { + $self->pidl("if ($varname == NULL) {"); + $self->indent; + $self->pidl("Py_RETURN_NONE;"); + $self->deindent; + $self->pidl("}"); + } $self->ConvertObjectToPython("pytalloc_get_mem_ctx(obj)", $env, $e, $varname, "py_$e->{NAME}", "return NULL;"); $self->pidl("return py_$e->{NAME};"); $self->deindent; diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index 39c09a82403..e506d94f474 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -259,8 +259,6 @@ static PyObject *py_imessaging_deregister(PyObject *self, PyObject *args, PyObje imessaging_deregister(iface->msg_ctx, msg_type, callback); - Py_DECREF(callback); - Py_RETURN_NONE; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6b96ae8316b auth/kerberos: clang: Fix same instances of 'Value stored is never read' via d54f9aaf81e s4/dsdb/schema: clang: Fix Array access results in null pointer deref via 50a22849ce1 s4/dsdb/schema: Fix 'Value stored to 'ret' is never read' via 109b4381815 s4/dsdb/schema: Fix Access to field results in deference of null pointer via 96e00a52587 s3/lib: Fix Access to field results in dereference of NULL pointer via 17ce70d6d9c lib/param: clang: Fix Value stored is never read via d759f4aa4b8 lib/util: clang: Fix 'Null pointer passed as an argument' from f3e4a0d904a WHATSNEW: changed default/deprecation of allocation roundup size https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6b96ae8316b748372819b0eabaee5c5e2a997d69 Author: Noel Power Date: Thu Jul 4 11:54:18 2019 + auth/kerberos: clang: Fix same instances of 'Value stored is never read' Fixes: auth/kerberos/gssapi_pac.c:136:3: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer(_min, _buffer); ^ ~ auth/kerberos/gssapi_pac.c:137:3: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer(_min, _display_buffer); ^ ~ auth/kerberos/gssapi_pac.c:265:4: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer_set(_min, ); ^ ~~ auth/kerberos/gssapi_pac.c:273:4: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer_set(_min, ); ^ ~~ auth/kerberos/gssapi_pac.c:279:4: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer_set(_min, ); ^ ~~ auth/kerberos/gssapi_pac.c:285:5: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer_set(_min, ); ^ ~~ auth/kerberos/gssapi_pac.c:291:2: warning: Value stored to 'gss_maj' is never read <--[clang] gss_maj = gss_release_buffer_set(_min, ); ^ ~~ 7 warnings generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Jul 8 11:04:15 UTC 2019 on sn-devel-184 commit d54f9aaf81e03d6a7d0e270a88c744f51af507f7 Author: Noel Power Date: Thu Jul 4 11:50:29 2019 + s4/dsdb/schema: clang: Fix Array access results in null pointer deref Fixes: source4/dsdb/schema/schema_query.c:223:15: warning: Array access (from variable 'attr_list') results in a null pointer dereference <--[clang] attr_list[i] = NULL; ~^ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 50a22849ce11aebead43e39ea42541afdd987408 Author: Noel Power Date: Wed Jul 3 14:56:55 2019 + s4/dsdb/schema: Fix 'Value stored to 'ret' is never read' Fixes: source4/dsdb/schema/schema_set.c:274:3: warning: Value stored to 'ret' is never read <--[clang] ret = LDB_SUCCESS; ^ ~~~ source4/dsdb/schema/schema_set.c:327:3: warning: Value stored to 'ret' is never read <--[clang] ret = LDB_SUCCESS; ^ ~~~ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 109b438181563ed0074780df59a77bcdd7793e9d Author: Noel Power Date: Wed Jul 3 12:51:01 2019 + s4/dsdb/schema: Fix Access to field results in deference of null pointer Fixes: source4/dsdb/schema/schema_info_attr.c:207:38: warning: Access to field 'revision' results in a dereference of a null pointer (loaded from variable 'schema_info') <--[clang] if (schema->schema_info->revision > schema_info->revision) { ^~~ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 96e00a525876ba13250c6428c014d58464fcf5f3 Author: Noel Power Date: Wed Jul 3 12:45:56 2019 + s3/lib: Fix Access to field results in dereference of NULL pointer Fixes: ource3/lib/messages_dgm.c:176
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fa2d5b3daa0 lib: Fix return of server_id_db_prune_name() via f4430086fa2 tdb: Adapt _tdb_transaction_cancel() to README.Coding via 4ef5a42ca20 tdb: Adapt tdb_rescue() to README.Coding via c3bad08e2b0 lib/krb5_wrap: Fix leaking using mkstemp from 9b017ab0465 smbd: Simplify filename_convert_internal() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fa2d5b3daa0eaae41e2c2348cb2a81adf9da3b62 Author: Volker Lendecke Date: Mon Jul 1 21:07:55 2019 +0200 lib: Fix return of server_id_db_prune_name() The tdb routines return 0/-1 and return the specific error via tdb_error(). server_id_db_prune_name() is expected to return an errno, not 0/-1. Signed-off-by: Volker Lendecke Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Jul 3 10:51:32 UTC 2019 on sn-devel-184 commit f4430086fa2345c9ccf94644d92c08fd47f6a493 Author: Volker Lendecke Date: Mon Jul 1 21:02:21 2019 +0200 tdb: Adapt _tdb_transaction_cancel() to README.Coding Signed-off-by: Volker Lendecke Reviewed-by: Noel Power commit 4ef5a42ca2025b10674a4800d471ea29735c0906 Author: Volker Lendecke Date: Mon Jul 1 21:00:23 2019 +0200 tdb: Adapt tdb_rescue() to README.Coding Signed-off-by: Volker Lendecke Reviewed-by: Noel Power commit c3bad08e2b0913e5e49ffadb4780bb51154a3215 Author: Noel Power Date: Tue Jul 2 09:29:47 2019 +0100 lib/krb5_wrap: Fix leaking using mkstemp commit: 8b92539997a9df8e0d217790fd82fc8f59ea50cc introduced a leak by replacing mktemp with mkstemp (mkstemp returns an open fd) Signed-off-by: Noel Power Reviewed-by: Andreas Schneider --- Summary of changes: lib/krb5_wrap/krb5_samba.c | 7 +-- lib/tdb/common/rescue.c | 2 +- lib/tdb/common/transaction.c | 2 +- lib/util/server_id_db.c | 7 ++- 4 files changed, 13 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index 37257ddfe03..72889fffcf0 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -2001,6 +2001,7 @@ krb5_error_code smb_krb5_kinit_keyblock_ccache(krb5_context ctx, char tmp_name[sizeof(SMB_CREDS_KEYTAB)]; krb5_keytab_entry entry; krb5_keytab keytab; + int tmpfd; mode_t mask; memset(, 0, sizeof(entry)); @@ -2009,11 +2010,13 @@ krb5_error_code smb_krb5_kinit_keyblock_ccache(krb5_context ctx, memcpy(tmp_name, SMB_CREDS_KEYTAB, sizeof(SMB_CREDS_KEYTAB)); mask = umask(S_IRWXO | S_IRWXG); - mkstemp(tmp_name); + tmpfd = mkstemp(tmp_name); umask(mask); - if (tmp_name[0] == 0) { + if (tmpfd == -1) { + DBG_ERR("Failed to mkstemp %s\n", tmp_name); return KRB5_KT_BADNAME; } + close(tmpfd); code = krb5_kt_resolve(ctx, tmp_name, ); if (code) { return code; diff --git a/lib/tdb/common/rescue.c b/lib/tdb/common/rescue.c index 7e6580957bb..e608db41dea 100644 --- a/lib/tdb/common/rescue.c +++ b/lib/tdb/common/rescue.c @@ -300,7 +300,7 @@ _PUBLIC_ int tdb_rescue(struct tdb_context *tdb, qsort(found.arr, found.num, sizeof(found.arr[0]), cmp_key); } - for (i = 0; found.arr && i < found.num; ) { + for (i = 0; (found.arr != NULL) && i < found.num; ) { unsigned int num, num_in_hash = 0; /* How many are identical? */ diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index 06710896b6b..e9b0b26ea59 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -610,7 +610,7 @@ static int _tdb_transaction_cancel(struct tdb_context *tdb) /* free all the transaction blocks */ for (i=0;itransaction->num_blocks;i++) { - if (tdb->transaction->blocks && + if ((tdb->transaction->blocks != NULL) && tdb->transaction->blocks[i] != NULL) { free(tdb->transaction->blocks[i]); } diff --git a/lib/util/server_id_db.c b/lib/util/server_id_db.c index bb61f316d29..17b157706b4 100644 --- a/lib/util/server_id_db.c +++ b/lib/util/server_id_db.c @@ -184,7 +184,12 @@ int server_id_db_prune_name(struct server_id_db *db, const char *name, tdb_chainunlock(tdb, key); - return ret; + if (ret == -1) { + enum TDB_ERROR err = tdb_error(tdb); + return map_unix_error_from_tdb(err); + } + + return 0; } int server_id_db_remove(struct server_id_db *db, const char *name) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a77fda0cd4b lib tdb: memcmp ubsan warning via 2b7236ffe1a lib/krb5_wrap: clang: Fix warning: Null pointer passed as an argument via 8b92539997a lib/krb5_wrap: clang: Fix warning: Call to function 'mktemp' is insecure via 7bddd6aefe3 lib/util: clang: Fix warning: Value stored to 'ret' is never read warning via 3b43daaccbb lib/ldb/common: clang: Fix Value stored to 'ret' is never read warning via 9e78f7b53d9 lib/tdb/common: Fix Array access results in a null pointer dereference via 848290d37fd lib/tdb/common: Fix warning: Null pointer passed as argument to param via dcaaf9ff7a2 lib/util: Fix Value stored to 'ret' is never read warning from 043334f2eb6 util: Fix signed/unsigned comparisons by casting https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a77fda0cd4b9ec89024c7ac8a3f77797e00f4263 Author: Gary Lockyer Date: Thu Jun 6 14:57:45 2019 +1200 lib tdb: memcmp ubsan warning Fix the ubsan warning lib/tdb/common/tdb.c:184:9: runtime error: null pointer passed as argument 2, which is declared to never be null" memcmp call now guarded by a length check. memcmp returns zero when called with a zero length parameter. Signed-off-by: Gary Lockyer Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Jul 1 14:50:54 UTC 2019 on sn-devel-184 commit 2b7236ffe1a0454756b76f8dc302649e92cefbaa Author: Noel Power Date: Tue Jun 18 10:47:29 2019 + lib/krb5_wrap: clang: Fix warning: Null pointer passed as an argument Fixes: lib/krb5_wrap/krb5_samba.c:3241:3: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] memcpy(gss_cksum + 28, in_data->data, orig_length); ^ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 8b92539997a9df8e0d217790fd82fc8f59ea50cc Author: Noel Power Date: Tue Jun 18 10:42:06 2019 + lib/krb5_wrap: clang: Fix warning: Call to function 'mktemp' is insecure Fixes: lib/krb5_wrap/krb5_samba.c:2012:2: warning: Call to function 'mktemp' is insecure as it always creates or uses insecure temporary file. Use 'mkstemp' instead <--[clang] mktemp(tmp_name); ^~ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 7bddd6aefe3bd764560e5284f9a192797051bb2d Author: Noel Power Date: Tue Jun 18 10:19:09 2019 + lib/util: clang: Fix warning: Value stored to 'ret' is never read warning Fixes: lib/util/server_id_db.c:181:3: warning: Value stored to 'ret' is never read <--[clang] ret = tdb_store(tdb, key, talloc_tdb_data(ids), TDB_MODIFY); ^ ~ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 3b43daaccbb80824d8da10c84306ebf99268ec01 Author: Noel Power Date: Tue Jun 18 10:12:49 2019 + lib/ldb/common: clang: Fix Value stored to 'ret' is never read warning Fixes: lib/ldb/common/ldb.c:1091:3: warning: Value stored to 'ret' is never read <--[clang] ret = 0; ^ ~ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 9e78f7b53d94816446e33f3d53a4d240807552ec Author: Noel Power Date: Tue Jun 18 10:04:54 2019 + lib/tdb/common: Fix Array access results in a null pointer dereference Fixes; lib/tdb/common/transaction.c:613:7: warning: Array access (via field 'blocks') results in a null pointer dereference <--[clang] if (tdb->transaction->blocks[i] != NULL) { ^ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 848290d37fdb381b43db12675e771b462eefe7ef Author: Noel Power Date: Mon Jun 17 16:54:32 2019 +0100 lib/tdb/common: Fix warning: Null pointer passed as argument to param Fixes: lib/tdb/common/rescue.c:299:2: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] qsort(found.arr, found.num, sizeof(found.arr[0]), cmp_key); ^ ~~~~~ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit dcaaf9ff7a281910ba12e7e9f701641f6eb97262 Author: Noel Power Date: Mon Jun 17 15:23:42 2019 + lib/util: Fix Value stored to 'ret' is never read warning Fixes: lib/util/tfork.c:260:3: warning: Value stored to 'ret' is never read <--[clang] Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- Summary of changes:
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 164570fcbbe lib/param: clang: Fix 'dereference of a null pointer' warning via 9c586845665 librpc/ndr: clang: Fix warning 'Value stored to 'towernum' is never read' via fd17d50f7cb lib/dwrap: Fix 'Null pointer passed as an argument to a 'nonnull' parameter ' via 37add5c8ce7 lib/dbwrap: clang: Fix 'all argument is an uninitialized value' via 1d00bd9f0ba lib/util: clang: Fix Value stored during its initialization is never read via cf43f1d052a clang: Fix Null pointer passed as argument warning via 7987e4af96b lib/tdb: clang: Fix warning: Dereference of null pointer from e28365c5157 selftest: schema version check in provision test https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 164570fcbbee16a7b42a0adb49c471f198b54a39 Author: Noel Power Date: Fri Jun 14 13:57:59 2019 + lib/param: clang: Fix 'dereference of a null pointer' warning Fixes: lib/param/loadparm.c:3325:36: warning: Access to field 'szService' results in a dereference of a null pointer (loaded from variable 'service') <--[clang] return lpcfg_string((const char *)service->szService) Signed-off-by: Noel Power Reviewed-by: Gary Lockyer Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Jun 26 11:53:08 UTC 2019 on sn-devel-184 commit 9c586845665b779a698fad98dede42c214cfbff4 Author: Noel Power Date: Fri Jun 14 13:49:47 2019 + librpc/ndr: clang: Fix warning 'Value stored to 'towernum' is never read' Fixes: librpc/ndr/ndr_orpc.c:140:2: warning: Value stored to 'towernum' is never read <--[clang] towernum = 0; ^ ~ 1 warning generated. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit fd17d50f7cb8747c66e64e788bbd45212410d9c7 Author: Noel Power Date: Fri Jun 14 13:40:28 2019 + lib/dwrap: Fix 'Null pointer passed as an argument to a 'nonnull' parameter ' Fixes: lib/dbwrap/dbwrap.c:645:4: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] memcpy(p, dbufs[i].dptr, thislen); Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 37add5c8ce705f9a2d0ab77d6ef07885d72463c7 Author: Noel Power Date: Fri Jun 14 13:36:31 2019 + lib/dbwrap: clang: Fix 'all argument is an uninitialized value' Fixes: lib/dbwrap/dbwrap.c:533:4: warning: 2nd function call argument is an uninitialized value <--[clang] dbwrap_lock_order_unlock(db, lockptr); ^ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 1d00bd9f0ba7849e98b6a437ef29aeea725b5444 Author: Noel Power Date: Thu Jun 13 18:26:18 2019 + lib/util: clang: Fix Value stored during its initialization is never read Fixes: lib/util/util_tdb.c:385:11: warning: Value stored to 'result' during its initialization is never read <--[clang] Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit cf43f1d052a44bea08bef09ea5eace77143c8093 Author: Noel Power Date: Thu Jun 13 13:39:22 2019 + clang: Fix Null pointer passed as argument warning Fixes: lib/tdb/common/transaction.c:354:2: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] memcpy(tdb->transaction->blocks[blk] + off, buf, len); & Signed-off-by: Noel Power Reviewed-by: Gary Lockyer commit 7987e4af96b1c2b285834a9d3a9c00b028039737 Author: Noel Power Date: Wed Jun 12 14:55:43 2019 + lib/tdb: clang: Fix warning: Dereference of null pointer Fixes: lib/tdb/common/lock.c:933:6: warning: Dereference of null pointer <--[clang] if (tdb->allrecord_lock.count) { ^~~~~ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- Summary of changes: lib/dbwrap/dbwrap.c | 7 --- lib/param/loadparm.c | 2 +- lib/tdb/common/lock.c| 3 +++ lib/tdb/common/transaction.c | 2 +- lib/util/util_tdb.c | 5 - librpc/ndr/ndr_orpc.c| 1 - 6 files changed, 13 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c index 5e307ee47cd..f8eefcca02d 100644 --- a/lib/dbwrap/dbwrap.c +++ b/lib/dbwrap/dbwrap.c @@ -520,7 +520,7 @@ NTSTATUS dbwrap_do_locked(struct db_context *db, TDB_DATA key, struct db_record *rec; if (db->do_locked != NULL) { - struct db_context **lockptr; + struct db_context **lockptr = NULL; NTSTATUS stat
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4f32983ea8a py3: Remove duplicated PyUnicode_Check() after the py3 compat macros were removed via f32779b1982 py3: Remove PyStr_AsUTF8AndSize() compatability macro via 7566268f386 py3: Remove PyStr_AsUTF8() compatability macro via f178daa854d py3: Remove PyStr_AsString() compatability macro via d9d9463fd3c py3: Remove PyStr_FromFormatV() compatability macro via 75d87b29f11 py3: Remove PyStr_FromFormat() compatability macro via 3fa00d43504 py3: Remove PyStr_FromStringAndSize() compatability macro via 34f9a089d8d py3: Remove PyStr_FromString() compatability macro via f498c819664 py3: Remove PyStr_Check() compatability macro via 559dd2d25a6 py3: Remove PyStr_Type() compatability macro from 5ae1767970d s4:ntp_signd: Use gnutls_error_to_ntstatus() in ntp_signd https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4f32983ea8a24466165c043a73cb47b4073da15f Author: Andrew Bartlett Date: Sat Jun 15 23:14:49 2019 +1200 py3: Remove duplicated PyUnicode_Check() after the py3 compat macros were removed This came about because in py2 we had to check for strings and unicode. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Jun 24 18:48:53 UTC 2019 on sn-devel-184 commit f32779b198258da5b28cad6e810e4017c9f6dbc9 Author: Andrew Bartlett Date: Fri Jun 7 11:44:48 2019 +0200 py3: Remove PyStr_AsUTF8AndSize() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 7566268f386b7014d3cfad802c4c46cd7b2b3956 Author: Andrew Bartlett Date: Fri Jun 7 11:21:15 2019 +0200 py3: Remove PyStr_AsUTF8() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit f178daa854dc4ea9cb917d17cd4c8a876356e981 Author: Andrew Bartlett Date: Fri Jun 7 11:16:25 2019 +0200 py3: Remove PyStr_AsString() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit d9d9463fd3c7eda14a3170e214d6a56c9efbbcec Author: Andrew Bartlett Date: Fri Jun 7 11:13:03 2019 +0200 py3: Remove PyStr_FromFormatV() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 75d87b29f11a1dacb37ccc1b10f8d034063ef5ba Author: Andrew Bartlett Date: Fri Jun 7 11:08:55 2019 +0200 py3: Remove PyStr_FromFormat() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 3fa00d435045e6faeb92f5379684f118b131c92c Author: Andrew Bartlett Date: Fri Jun 7 11:01:19 2019 +0200 py3: Remove PyStr_FromStringAndSize() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 34f9a089d8d3a8971b2f7ee45f6d8e823a52a193 Author: Andrew Bartlett Date: Fri Jun 7 10:45:52 2019 +0200 py3: Remove PyStr_FromString() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit f498c819664e9df658651d39f616f5b4d62b4750 Author: Andrew Bartlett Date: Fri Jun 7 10:39:11 2019 +0200 py3: Remove PyStr_Check() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power commit 559dd2d25a644239902753e842b808bac1a0b439 Author: Andrew Bartlett Date: Fri Jun 7 10:27:34 2019 +0200 py3: Remove PyStr_Type() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power --- Summary of changes: auth/credentials/pycredentials.c | 2 +- lib/ldb/pyldb.c | 109 ++- lib/ldb/pyldb_util.c | 12 +--- lib/talloc/pytalloc.c
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 49e2d369186 lib/tdb/common: clang: Fix 'Value stored to 'last_ptr' is never read' via 0152925879d librpc/ndr: clang: Fix Assigned value is garbage or undefined warning via e104c01846f lib/util: clang: Fix dereference of a null pointer warning via acd65542069 lib/util: clang: Fix a dereference of a null pointer warning(s) via add47e288bc lib/util/charset: clang: Fix Value stored to 'reason' is never read warning via c8293d84597 lib/util: clang: Fix 'Null pointer passed as an argument...' warning via f7b816e2b7c DLIST_REMOVE: clang: Fix dereference of a null pointer warning via 8f422ada8c4 lib/tevent: clang: via 1c6db152bf1 s4/torture/rpc: cppcheck: Fix ctunullpointer error from 7cc9e3fe24d s3/vfs_glusterfs_fuse: Avoid using NAME_MAX directly https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 49e2d36918673e7922e4c983809ad1481db63f96 Author: Noel Power Date: Mon May 27 15:47:54 2019 + lib/tdb/common: clang: Fix 'Value stored to 'last_ptr' is never read' Fixes lib/tdb/common/freelistcheck.c:96:3: warning: Value stored to 'last_ptr' is never read <--[clang] last_ptr = rec_ptr; ^ ~~~ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer g...@catalyst.net.nz Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jun 11 13:31:01 UTC 2019 on sn-devel-184 commit 0152925879d68524e69ed5f02b323fe1bd7f706a Author: Noel Power Date: Fri May 24 14:16:40 2019 + librpc/ndr: clang: Fix Assigned value is garbage or undefined warning Fixes: librpc/ndr/ndr_basic.c:170:5: warning: Assigned value is garbage or undefined <--[clang] Signed-off-by: Noel Power Reviewed-by: Gary Lockyer g...@catalyst.net.nz commit e104c01846f6b8bcfb4a3efb269b8b357d17eea6 Author: Noel Power Date: Fri May 24 14:08:58 2019 + lib/util: clang: Fix dereference of a null pointer warning Fixes: lib/util/rbtree.c:170:8: warning: Access to field 'rb_parent_color' results in a dereference of a null pointer (loaded from variable 'other') <--[clang] We could avoid accessing the NULL pointer but previously the code would have crashed here. Given this is a rbtree probably better to preserve the fatal nature of encountering a NULL pointer here while satisfying the static checker. Signed-off-by: Noel Power Reviewed-by: Gary Lockyer g...@catalyst.net.nz commit acd65542069457cf24dd64d5c6625e88cb7242fb Author: Noel Power Date: Fri May 24 14:03:37 2019 + lib/util: clang: Fix a dereference of a null pointer warning(s) Fixes: lib/util/ms_fnmatch.c:75:8: warning: Access to field 'predot' results in a dereference of a null pointer (loaded from variable 'max_n') <--[clang] if (max_n->predot && max_n->predot <= n) { ^ lib/util/ms_fnmatch.c:91:8: warning: Access to field 'predot' results in a dereference of a null pointer (loaded from variable 'max_n') <--[clang] if (max_n->predot && max_n->predot <= n) { Signed-off-by: Noel Power Reviewed-by: Gary Lockyer g...@catalyst.net.nz commit add47e288bc80c1bf45765d1588a9fa5998ea677 Author: Noel Power Date: Fri May 24 13:37:00 2019 + lib/util/charset: clang: Fix Value stored to 'reason' is never read warning Fixes: lib/util/charset/convert_string.c:301:5: warning: Value stored to 'reason' is never read <--[clang] Signed-off-by: Noel Power Reviewed-by: Gary Lockyer g...@catalyst.net.nz commit c8293d8459711e7f67cbd10f508868e463cbccac Author: Noel Power Date: Fri May 24 13:32:09 2019 + lib/util: clang: Fix 'Null pointer passed as an argument...' warning Fixes: lib/util/debug.c:705:7: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] Signed-off-by: Noel Power Reviewed-by: Gary Lockyer g...@catalyst.net.nz commit f7b816e2b7c2e67088e0236b0cebae1d0baa0e21 Author: Noel Power Date: Fri May 24 13:07:46 2019 + DLIST_REMOVE: clang: Fix dereference of a null pointer warning Fixes: lib/tevent/tevent_wrapper.c:295:3: warning: Access to field 'next' results in a dereference of a null pointer (loaded from field 'prev') <--[clang] Additionally fix similar instance of the same macro Signed-off-by: Noel Power Reviewed-by: Gary Lockyer g...@catalyst.net.nz commit 8f422ada8c4d4efc0a9122479b4719c0086281d7 Author: Noel Power Date: Fri May 24 13:01:30 2019 + lib/tevent: clang: Fixes: lib/tevent/tevent_wrapper.c:213:6: warn
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 0ae585db267 samba-tool dns: use bytes for inet_ntop via 32b282d55e8 tests/samba-tool: test dns serverinfo/zoneinfo via 6555fa9d8fb s3/smbd: cppcheck: Fix ctunullpointer error via 02017d35f43 s3/printing: cppcheck avoid 'nullPointerArithmetic:' error via 5477b83db28 s3/lib: don't write to buffer (which might be NULL) if bufsize <=0 via 75afaeb7499 s3/lib/netapi: Fix 'Possible null pointer dereference' warning via f5af3cb21e2 s3/libads: cppcheck fix error: shiftTooManyBitsSigned: error via fd3f37af927 lib/util: Fix cppcheck null pointer dereference warning from 8831b06d3d4 ldb: Release ldb 2.0.3 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 0ae585db26727a944c957cb543bf72175dc55599 Author: Douglas Bagnall Date: Fri May 24 09:58:12 2019 +1200 samba-tool dns: use bytes for inet_ntop From Python's point of view, array.AddrArray is a list of byte-valued integers. In Python 3 we can convert directly using the likes of bytes(array.AddrArray[i].MaxSa[8:24]) but in 4.10 we need to support both, so we use struct. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Wed May 29 11:29:17 UTC 2019 on sn-devel-184 commit 32b282d55eaa7bbe02d95502669f1c714726 Author: Douglas Bagnall Date: Wed May 29 13:38:12 2019 +1200 tests/samba-tool: test dns serverinfo/zoneinfo Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 6555fa9d8fbc7f7be39f5ffc3a31ef14af92779c Author: Noel Power Date: Tue May 21 13:36:45 2019 + s3/smbd: cppcheck: Fix ctunullpointer error Fixes: source3/smbd/files.c:783: error: ctunullpointer: Null pointer dereference: buf <--[cppcheck] Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit 02017d35f43b69b988841b29bd68c5b440edb4e7 Author: Noel Power Date: Tue May 21 12:56:06 2019 +0100 s3/printing: cppcheck avoid 'nullPointerArithmetic:' error source3/printing/notify.c:94: error: nullPointerArithmetic: Pointer addition with NULL pointer. <--[cppcheck] /home/samba/samba-pidl/source3/printing/notify.c:96: error: nullPointerArithmetic: Pointer addition with NULL pointer. <--[cppcheck] /home/samba/samba-pidl/source3/printing/notify.c:103: error: nullPointerArithmetic: Pointer addition with NULL pointer. <--[cppcheck] flatten_message function depends on behaviour of tdb_pack which will return the bytes that would be written (without actually writing to the buffer) if the bufsize passed is <=0. What we need to avoid here is the default modification of buf (when it is initially NULL) Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit 5477b83db28c67743e25a638c93bc4117a8a7ced Author: Noel Power Date: Tue May 21 13:08:15 2019 + s3/lib: don't write to buffer (which might be NULL) if bufsize <=0 Some code depends that tdb_pack[va] will return the bytes it would write to 'buf' if the bufsize passed in is <=0, writing to the buffer is protected by with lines like if (bufsize && bufsize >= len) { /* write to 'buf' */ } however in these instances the local pointer to the buffer is still modified buf += len; It's quite probable if bufsize == 0 that buf itself is NULL, in this case we should protect against performing pointer arithmetic. Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit 75afaeb749991925f17517ce50a96178d32d7922 Author: Noel Power Date: Tue May 21 11:00:42 2019 + s3/lib/netapi: Fix 'Possible null pointer dereference' warning source3/lib/netapi/localgroup.c:1103: warning: nullPointer: Possible null pointer dereference: r <--[cppcheck] Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit f5af3cb21e2515096d0b21aabda238a1c8f3bab3 Author: Noel Power Date: Tue May 21 10:52:56 2019 + s3/libads: cppcheck fix error: shiftTooManyBitsSigned: error Squash 'Shifting signed 32-bit value by 31 bits is undefined behaviour' error Signed-off-by: Noel Power Reviewed-by: Andreas Schneider commit fd3f37af927cd926431a5dbd8f966d8c8e772dae Author: Noel Power Date: Tue May 21 10:48:18 2019 + lib/util: Fix cppcheck null pointer dereference warning lib/util/talloc_report.c:58: warning: nullPointer: Possible null pointer dereference: start <--[cppcheck] Signed-off-by: Noel Power Reviewed-by: Andreas Schneider --- Summary of changes: lib/util/talloc_report.c| 2 ++ pyt
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1a9da378a15 sambaundoguididx: Add flags=ldb.FLG_DONT_CREATE_DB and port to Python3 from 3b608510e4b third_party: Update nss_wrapper to version 1.1.6 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1a9da378a1505daff498be6d6355debd73526a1a Author: Andrew Bartlett Date: Mon May 20 16:29:10 2019 +1200 sambaundoguididx: Add flags=ldb.FLG_DONT_CREATE_DB and port to Python3 In py3 we need to add an extra str() around the returned ldb value to enable .split() to be used. Signed-off-by: Andrew Bartlett Reviewed By: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu May 23 14:25:52 UTC 2019 on sn-devel-184 --- Summary of changes: source4/scripting/bin/sambaundoguididx | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/scripting/bin/sambaundoguididx b/source4/scripting/bin/sambaundoguididx index 00fe63897b4..f67353ff361 100755 --- a/source4/scripting/bin/sambaundoguididx +++ b/source4/scripting/bin/sambaundoguididx @@ -34,7 +34,9 @@ if opts.H is None: else: url = opts.H -samdb = ldb.Ldb(url=url, options=["modules:"]) +samdb = ldb.Ldb(url=url, +flags=ldb.FLG_DONT_CREATE_DB, +options=["modules:"]) partitions = samdb.search(base="@PARTITION", scope=ldb.SCOPE_BASE, @@ -58,10 +60,11 @@ privatedir = os.path.dirname(url) dbs = [] for part in partitions[0]['partition']: -tdbname = part.split(":")[1] -tdbpath = os.path.join(privatedir, tdbname) - -db = ldb.Ldb(url=tdbpath, options=["modules:"]) +dbname = str(part).split(":")[1] +dbpath = os.path.join(privatedir, dbname) +db = ldb.Ldb(url="ldb://" + dbpath, + options=["modules:"], + flags=ldb.FLG_DONT_CREATE_DB) db.transaction_start() db.modify(modmsg) dbs.append(db) @@ -73,7 +76,8 @@ samdb.transaction_commit() print("Re-opening with the full DB stack") samdb = SamDB(url=url, - lp=lp_ctx) + flags=ldb.FLG_DONT_CREATE_DB, + lp=lp_ctx) print("Re-triggering another re-index") chk = dbcheck(samdb) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 76967b33ebb pyldb: avoid segfault when adding an element with no name via 1d7dee5815d pytest/segfault: segfault with nameless element from e24e344d0da waf: install: Remove installation of PIDL and manpages. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 76967b33ebb93a7ef5daa94b123ef9bfdce59ece Author: Douglas Bagnall Date: Fri Apr 12 15:00:20 2019 +1200 pyldb: avoid segfault when adding an element with no name We don't want to see this: python3 -c "import sys sys.path.insert(0, 'bin/python') import ldb m = ldb.Message() e = ldb.MessageElement('q') try: m.add(e) except ldb.LdbError: pass print(m) " Segmentation fault (core dumped) instead we want this: Traceback (most recent call last): File "", line 7, in ValueError: The element has no name Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Apr 23 19:03:35 UTC 2019 on sn-devel-144 commit 1d7dee5815d1eaf43f841231767e19d110551aa3 Author: Douglas Bagnall Date: Sat Apr 13 11:29:15 2019 +1200 pytest/segfault: segfault with nameless element Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: lib/ldb/pyldb.c| 6 +- python/samba/tests/segfault.py | 10 ++ 2 files changed, 15 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 6e845d15c36..319840c2ea6 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -3528,7 +3528,11 @@ static PyObject *py_ldb_msg_add(PyLdbMessageObject *self, PyObject *args) PyErr_SetString(PyExc_ValueError, "Invalid MessageElement object"); return NULL; } - + if (el->name == NULL) { + PyErr_SetString(PyExc_ValueError, + "The element has no name"); + return NULL; + } ret = ldb_msg_add_empty(msg, el->name, el->flags, _new); PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, NULL); diff --git a/python/samba/tests/segfault.py b/python/samba/tests/segfault.py index 38dcb5c7036..b95c1ef5fa9 100644 --- a/python/samba/tests/segfault.py +++ b/python/samba/tests/segfault.py @@ -124,3 +124,13 @@ class SegfaultTests(samba.tests.TestCase): registry.open_ldb('', credentials=42) except ldb.LdbError as e: print("failed with %s" % e) + +@segfault_detector +def test_ldb_add_nameless_element(self): +m = ldb.Message() +e = ldb.MessageElement('q') +try: +m.add(e) +except ldb.LdbError: +pass +str(m) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 7a413a6dab3 python/samba: ignore encoding errors while reading files via d01c5bc9fbe provision: use ASCII quotes from c7f403d3730 lib:util: Include talloc_keep_secret.h in samba_util.h https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 7a413a6dab3b0ffe4ea210adfd79d93d1b62215c Author: Philipp Gesang Date: Tue Mar 12 15:43:42 2019 +0100 python/samba: ignore encoding errors while reading files Provisioning fails on C locale due to the Unicode quotes in ldif data. Patch read_and_sub_file() to read the files as UTF-8. Signed-off-by: Philipp Gesang Reviewed-by: Douglas Bagnall Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Apr 3 11:33:38 UTC 2019 on sn-devel-144 commit d01c5bc9fbe316d2358ead6382f4e7e3bf5fc000 Author: Philipp Gesang Date: Tue Mar 12 15:51:16 2019 +0100 provision: use ASCII quotes Remove some Unicode quotes that cause problems under the C locale. Signed-off-by: Philipp Gesang Reviewed-by: Douglas Bagnall --- Summary of changes: python/samba/__init__.py | 2 +- source4/setup/extended-rights.ldif | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 93240dddfbb..d851bf3606c 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -280,7 +280,7 @@ def read_and_sub_file(file_name, subst_vars): :param file_name: File to be read (typically from setup directory) param subst_vars: Optional variables to subsitute in the file. """ -data = open(file_name, 'r').read() +data = open(file_name, 'r', encoding="utf-8").read() if subst_vars is not None: data = substitute_var(data, subst_vars) check_all_substituted(data) diff --git a/source4/setup/extended-rights.ldif b/source4/setup/extended-rights.ldif index ef4c3049601..67417b7d020 100644 --- a/source4/setup/extended-rights.ldif +++ b/source4/setup/extended-rights.ldif @@ -11,7 +11,7 @@ # # Technical Documentation. Microsoft publishes Open Specifications -# documentation (“this documentation”) for protocols, file formats, +# documentation ("this documentation") for protocols, file formats, # data portability, computer languages, and standards # support. Additionally, overview documents cover inter-protocol # relationships and interactions. -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 47278bfaa6d waf: Simplify condition for undefined symbol detection via 9314bd0b25c samba_dnsupdate: small tweaks to make code more pythonic from 92c726dc7a8 make some auth functions return an NTSTATUS like other similar functions for better diagnostics. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 47278bfaa6dec543be49c0d66a2418928356a4a3 Author: Michael Hanselmann Date: Sat Mar 23 00:14:52 2019 +0100 waf: Simplify condition for undefined symbol detection There's no need to check for OpenBSD twice. Signed-off-by: Michael Hanselmann Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Apr 2 17:28:40 UTC 2019 on sn-devel-144 commit 9314bd0b25c397deec6e431c7f64be9e5c00d02b Author: Joe Guo Date: Wed Mar 27 15:21:14 2019 +1300 samba_dnsupdate: small tweaks to make code more pythonic Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- Summary of changes: buildtools/wafsamba/samba_autoconf.py | 9 +++-- source4/scripting/bin/samba_dnsupdate | 68 ++- 2 files changed, 23 insertions(+), 54 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index ee1fc231eb9..98ffdfea458 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -919,12 +919,11 @@ def SETUP_CONFIGURE_CACHE(conf, enable): @conf def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf): -# we don't want any libraries or modules to rely on runtime -# resolution of symbols if not sys.platform.startswith("openbsd"): +# we don't want any libraries or modules to rely on runtime +# resolution of symbols conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True) -if not sys.platform.startswith("openbsd") and conf.env.undefined_ignore_ldflags == []: -if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']): +if (conf.env.undefined_ignore_ldflags == [] and +conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'])): conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup'] - diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index 3fb540b202c..2ecb2ce9f1d 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -91,35 +91,21 @@ lp = sambaopts.get_loadparm() domain = lp.get("realm") host = lp.get("netbios name") -if opts.all_interfaces: -all_interfaces = True -else: -all_interfaces = False +all_interfaces = opts.all_interfaces -if opts.current_ip: -IPs = opts.current_ip -else: -IPs = samba.interface_ips(lp, all_interfaces) +IPs = opts.current_ip or samba.interface_ips(lp, bool(all_interfaces)) or [] nsupdate_cmd = lp.get('nsupdate command') dns_zone_scavenging = lp.get("dns zone scavenging") -if len(IPs) == 0: +if not IPs: print("No IP interfaces - skipping DNS updates") sys.exit(0) -if opts.rpc_server_ip: -rpc_server_ip = opts.rpc_server_ip -else: -rpc_server_ip = IPs[0] +rpc_server_ip = opts.rpc_server_ip or IPs[0] -IP6s = [] -IP4s = [] -for i in IPs: -if i.find(':') != -1: -IP6s.append(i) -else: -IP4s.append(i) +IP6s = [ip for ip in IPs if ':' in ip] +IP4s = [ip for ip in IPs if ':' not in ip] smb_conf = sambaopts.get_loadparm_path() @@ -132,23 +118,18 @@ def get_possible_rw_dns_server(creds, domain): (4.6 and prior) do not maintain this value, so add NS servers as well""" -hostnames = [] ans_soa = check_one_dns_name(domain, 'SOA') - # Actually there is only one -for i in range(len(ans_soa)): -hostnames.append(str(ans_soa[i].mname).rstrip('.')) +hosts_soa = [str(a.mname).rstrip('.') for a in ans_soa] # This is not strictly legit, but old Samba domains may have an # unmaintained SOA record, so go for any NS that we can get a # ticket to. ans_ns = check_one_dns_name(domain, 'NS') - # Actually there is only one -for i in range(len(ans_ns)): -hostnames.append(str(ans_ns[i].target).rstrip('.')) +hosts_ns = [str(a.target).rstrip('.') for a in ans_ns] -return hostnames +return hosts_soa + hosts_ns def get_krb5_rw_dns_server(creds, domain): """Get a list of read-write DNS servers that we can obtain a ticket @@ -160,8 +141,7 @@ def get_krb5_rw_dns_server(creds, domain): rw_dns_servers = get_possible_rw_dns_server(creds, domain) # Actually
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c25e7953c6a pygpo: take ownership of password pointer via 5b4618ca7ac pygpo: Safer handling of memory for ads_ptr. via 18638535044 pygpo: Fix module initialization. via d2a75489477 pygpo: keep a reference to python credentials in the ADS struct to keep the internal pointer valid. via 1ff252e398c pygpo: More python exception cleanup. via a8b316d102e pygpo: Fix error handing when getting gpo unix path. via 08b5b11b96c pygpo: Proper exception exit in py_ads_connect(). via 36adf08fabb pygpo: Replace the use of SystemError with RuntimeError. from 80cf852dbe4 subunit/run.py: change shebang to python3 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c25e7953c6a4b26965bfbba40c793d13690ba68c Author: Kristján Valur Date: Thu Feb 28 15:15:14 2019 + pygpo: take ownership of password pointer BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Mar 7 15:08:19 UTC 2019 on sn-devel-144 commit 5b4618ca7ac04667b9f5c3b8b11b4f66cb7cac71 Author: Kristján Valur Date: Thu Feb 28 11:34:47 2019 + pygpo: Safer handling of memory for ads_ptr. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power commit 18638535044e7ce8589c0288c43de90bf1853d5f Author: Kristján Valur Date: Wed Feb 27 16:48:39 2019 + pygpo: Fix module initialization. * Add reference count to type. * Add error checking. * Remove unnecessary tp_new method. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power commit d2a75489477a6628662e7bb5dd94b3e769e8c3b1 Author: Kristján Valur Date: Wed Feb 27 16:36:32 2019 + pygpo: keep a reference to python credentials in the ADS struct to keep the internal pointer valid. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power commit 1ff252e398c6dc140570821394a7cda262af6dd9 Author: Kristján Valur Date: Wed Feb 27 16:32:14 2019 + pygpo: More python exception cleanup. * Don't override existing exceptions. * Careful with talloc contexts. * Return NULL on error. * Add more information to exception messages from internal functions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power commit a8b316d102e0e864dde4ab39cc20b98f32216ff4 Author: Kristján Valur Date: Wed Feb 27 16:03:16 2019 + pygpo: Fix error handing when getting gpo unix path. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power commit 08b5b11b96c5325d314a0ec8dc9291542e255f6f Author: Kristján Valur Date: Wed Feb 27 14:12:43 2019 + pygpo: Proper exception exit in py_ads_connect(). connect() now succeeds or raises an exception. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power commit 36adf08fabb4977e534eff30bccff30ce427787d Author: Kristján Valur Date: Wed Feb 27 13:36:03 2019 + pygpo: Replace the use of SystemError with RuntimeError. SystemError is reserved for internal errors in the interpreter. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- Summary of changes: libgpo/pygpo.c | 244 ++--- 1 file changed, 129 insertions(+), 115 deletions(-) Changeset truncated at 500 lines: diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index cd107318860..e82cc5c984f 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -74,7 +74,7 @@ static PyObject *py_gpo_get_unix_path(PyObject *self, PyObject *args, { NTSTATUS status; const char *cache_dir = NULL; - PyObject *ret = Py_None; + PyObject *ret = NULL; char *unix_path = NULL; TALLOC_CTX *frame = NULL; static const char *kwlist[] = {"cache_dir", NULL}; @@ -86,9 +86,6 @@ static PyObject *py_gpo_get_unix_path(PyObject *self, PyObject *args, if (!PyArg_ParseTupleAndKeywords(args,
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 80cf852dbe4 subunit/run.py: change shebang to python3 via 10109f62ceb tests/auto_log_pass_change.py: only care about the last expected message other than exact messages count via 02c7b8c03d4 subunit/run.py: make iso8601 UTC usage python 2/3 compatible from 8b18da27cf2 s4-server: Open and close a transaction on sam.ldb at startup https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 80cf852dbe4a8091e81e1515351aff393fc12af5 Author: Joe Guo Date: Thu Mar 7 12:12:00 2019 +1300 subunit/run.py: change shebang to python3 always use explicit python version at current stage. Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Mar 7 13:03:56 UTC 2019 on sn-devel-144 commit 10109f62ceb0cb435be3c521bd281eae48077535 Author: Joe Guo Date: Thu Mar 7 16:10:27 2019 +1300 tests/auto_log_pass_change.py: only care about the last expected message other than exact messages count The messages count could be different because of racing condition. And we should only care about the last expected one. Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett abart...@samba.org Reviewed-by: Noel Power npo...@samba.org commit 02c7b8c03d4970421a5170e44c57cbc3cda82827 Author: Joe Guo Date: Thu Mar 7 12:34:15 2019 +1300 subunit/run.py: make iso8601 UTC usage python 2/3 compatible In `iso8601/iso8601.py`: if sys.version_info >= (3, 2, 0): UTC = datetime.timezone.utc ... else: class Utc(datetime.tzinfo): ... UTC = Utc() The class `Utc` is only available for python < 3.2.0. Use `UTC` instance instead, which is python 2/3 compatible. Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- Summary of changes: python/samba/subunit/run.py| 8 ++--- python/samba/tests/auth_log_pass_change.py | 55 +- 2 files changed, 20 insertions(+), 43 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/subunit/run.py b/python/samba/subunit/run.py index 8f32d46ef49..e369b15aa02 100755 --- a/python/samba/subunit/run.py +++ b/python/samba/subunit/run.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Simple subunit testrunner for python # Copyright (C) Jelmer Vernooij 2014 @@ -24,7 +24,7 @@ $ python -m samba.subunit.run mylib.tests.test_suite """ -from iso8601.iso8601 import Utc +from iso8601.iso8601 import UTC import datetime import os @@ -184,7 +184,7 @@ class TestProtocolClient(unittest.TestResult): ":param datetime: A datetime.datetime object. """ -time = a_datetime.astimezone(Utc()) +time = a_datetime.astimezone(UTC) self._stream.write("time: %04d-%02d-%02d %02d:%02d:%02d.%06dZ\n" % ( time.year, time.month, time.day, time.hour, time.minute, time.second, time.microsecond)) @@ -458,7 +458,7 @@ class AutoTimingTestResultDecorator(HookedTestResultDecorator): time = self._time if time is not None: return -time = datetime.datetime.utcnow().replace(tzinfo=Utc()) +time = datetime.datetime.utcnow().replace(tzinfo=UTC) self.decorated.time(time) @property diff --git a/python/samba/tests/auth_log_pass_change.py b/python/samba/tests/auth_log_pass_change.py index 99548679a66..0300fbc06d1 100644 --- a/python/samba/tests/auth_log_pass_change.py +++ b/python/samba/tests/auth_log_pass_change.py @@ -100,12 +100,8 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase): net.change_password(newpassword=password, username=USER_NAME, oldpassword=USER_PASS) - -messages = self.waitForMessages(isLastExpectedMessage) -print("Received %d messages" % len(messages)) -self.assertEquals(8, - len(messages), - "Did not receive the expected number of messages") +self.assertTrue(self.waitForMessages(isLastExpectedMessage), +"Did not receive the expected message") def test_admin_change_password_new_password_fails_restriction(self): def isLastExpectedMessage(msg): @@ -136,11 +132,8 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase): exception_thrown = True self.assertEquals(True, exception_thrown, "Expected exception not thrown") - -
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6a7dd7ab510 tests: Reduce likelihood of auth_log test locking up during CI from f0ecfd384c2 pidl/Python: initialise a datablob https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6a7dd7ab510a85d4c5f6d7e740b6bbd58b714085 Author: Aaron Haslett Date: Thu Feb 28 16:55:31 2019 +1300 tests: Reduce likelihood of auth_log test locking up during CI We would sometimes see the auth_log test hang during a CI run. The CI job would eventually fail after consuming a costly 10 hours of CI runtime. We believe the problem is around the test creating multiple instances of the Messaging() context. This is a similar race condition to what was seen in 19f34b2161dee26. Currently a new Messaging() context is created for every test case. By using classmethods instead, the Messaging context is only created once per python test file execution (i.e. creation of the python class, rather than initialization of the python object, which happens for every test-case). This means the test will only create one Messaging() context, which should avoid any race conditions. Changes: + removed msg_ctxs - this wasn't actually used for anything. + use classmethods to setup and tear-down the Messaging() context (and tweak lp initialization accordingly). + fix discardMessages() - the loop wasn't actually discarding any messages previously (this may also have been the cause of the test hanging). Signed-off-by: Aaron Haslett Signed-off-by: Tim Beale Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Mar 5 13:10:43 UTC 2019 on sn-devel-144 --- Summary of changes: python/samba/tests/auth_log_base.py | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/tests/auth_log_base.py b/python/samba/tests/auth_log_base.py index d6a3976f456..09a8df0a4dc 100644 --- a/python/samba/tests/auth_log_base.py +++ b/python/samba/tests/auth_log_base.py @@ -27,14 +27,13 @@ import time import json import os import re - -msg_ctxs = [] +from samba import param class AuthLogTestBase(samba.tests.TestCase): -def setUp(self): -super(AuthLogTestBase, self).setUp() +@classmethod +def setUpClass(self): # connect to the server's messaging bus (we need to explicitly load a # different smb.conf here, because in all other respects this test # wants to act as a separate remote client) @@ -42,16 +41,14 @@ class AuthLogTestBase(samba.tests.TestCase): if server_conf: lp_ctx = LoadParm(filename_for_non_global_lp=server_conf) else: -lp_ctx = self.get_loadparm() +samba.tests.env_loadparm() self.msg_ctx = Messaging((1,), lp_ctx=lp_ctx) -global msg_ctxs -msg_ctxs.append(self.msg_ctx) self.msg_ctx.irpc_add_name(AUTH_EVENT_NAME) # Now switch back to using the client-side smb.conf. The tests will # use the first interface in the client.conf (we need to strip off # the subnet mask portion) -lp_ctx = self.get_loadparm() +lp_ctx = samba.tests.env_loadparm() client_ip_and_mask = lp_ctx.get('interfaces')[0] client_ip = client_ip_and_mask.split('/')[0] @@ -71,18 +68,21 @@ class AuthLogTestBase(samba.tests.TestCase): self.msg_ctx.register(self.msg_handler_and_context, msg_type=MSG_AUTH_LOG) -self.discardMessages() - self.remoteAddress = None self.server = os.environ["SERVER"] self.connection = None -def tearDown(self): +@classmethod +def tearDownClass(self): if self.msg_handler_and_context: self.msg_ctx.deregister(self.msg_handler_and_context, msg_type=MSG_AUTH_LOG) self.msg_ctx.irpc_remove_name(AUTH_EVENT_NAME) +def setUp(self): +super(AuthLogTestBase, self).setUp() +self.discardMessages() + def waitForMessages(self, isLastExpectedMessage, connection=None): """Wait for all the expected messages to arrive The connection is passed through to keep the connection alive @@ -126,11 +126,12 @@ class AuthLogTestBase(samba.tests.TestCase): return list(filter(isRemote, self.context["messages"])) # Discard any previously queued messages. +@classmethod def discardMessages(self): self.msg_ctx.loop_once(0.001) while len(self.context["messages"]): +self.context["messages"] = [] self.msg_ctx.loop_once(0.001) -
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 0c15c4b1db9 Make sure results from GetAttrString are decref'ed where needed via 8d3f736bba3 Fix instances of PyDict_SetItem to decref the value via 5dad03b83cd Fix mem leak with PyBytes_FromStringAndSize Reviewed-by: Andrew Bartlett abart...@samba.org from 30d505e91bb selftest: Only set clockskew to 5 seconds for MIT Kerberos https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 0c15c4b1db9ef12cc02683bbf24e0a2d10d1b991 Author: Noel Power Date: Mon Jan 28 16:57:17 2019 + Make sure results from GetAttrString are decref'ed where needed Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Feb 13 14:51:12 CET 2019 on sn-devel-144 commit 8d3f736bba3367ed615f97d292f86c447a25b8d5 Author: Noel Power Date: Mon Jan 28 15:23:59 2019 + Fix instances of PyDict_SetItem to decref the value Although it would be better to use the BuildValue approach to create the dictionares here, unfortunately the dictionaries created here have key/values that are created dynamically (based on input params). Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org commit 5dad03b83cd014277e2712ab04ad8a714d78a24c Author: Noel Power Date: Mon Jan 28 15:23:48 2019 + Fix mem leak with PyBytes_FromStringAndSize Reviewed-by: Andrew Bartlett abart...@samba.org --- Summary of changes: lib/ldb/pyldb.c| 5 +- source4/auth/gensec/pygensec.c | 9 +- source4/libnet/py_net.c| 9 +- source4/param/provision.c | 370 + 4 files changed, 278 insertions(+), 115 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 3deb393e467..10a4b6cb55d 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -4106,6 +4106,7 @@ static PyObject *py_register_module(PyObject *module, PyObject *args) int ret; struct ldb_module_ops *ops; PyObject *input; + PyObject *tmp; if (!PyArg_ParseTuple(args, "O", )) return NULL; @@ -4116,8 +4117,10 @@ static PyObject *py_register_module(PyObject *module, PyObject *args) return NULL; } - ops->name = talloc_strdup(ops, PyStr_AsUTF8(PyObject_GetAttrString(input, discard_const_p(char, "name"; + tmp = PyObject_GetAttrString(input, discard_const_p(char, "name")); + ops->name = talloc_strdup(ops, PyStr_AsUTF8(tmp)); + Py_XDECREF(tmp); Py_INCREF(input); ops->private_data = input; ops->init_context = py_module_init; diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c index d8f782f8d19..72981a22263 100644 --- a/source4/auth/gensec/pygensec.c +++ b/source4/auth/gensec/pygensec.c @@ -453,7 +453,7 @@ static PyObject *py_gensec_update(PyObject *self, PyObject *args) NTSTATUS status; TALLOC_CTX *mem_ctx; DATA_BLOB in, out; - PyObject *ret, *py_in; + PyObject *py_bytes, *result, *py_in; struct gensec_security *security = pytalloc_get_type(self, struct gensec_security); PyObject *finished_processing; @@ -477,7 +477,8 @@ static PyObject *py_gensec_update(PyObject *self, PyObject *args) talloc_free(mem_ctx); return NULL; } - ret = PyBytes_FromStringAndSize((const char *)out.data, out.length); + py_bytes = PyBytes_FromStringAndSize((const char *)out.data, +out.length); talloc_free(mem_ctx); if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { @@ -486,7 +487,9 @@ static PyObject *py_gensec_update(PyObject *self, PyObject *args) finished_processing = Py_True; } - return PyTuple_Pack(2, finished_processing, ret); + result = PyTuple_Pack(2, finished_processing, py_bytes); + Py_XDECREF(py_bytes); + return result; } static PyObject *py_gensec_wrap(PyObject *self, PyObject *args) diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c index 3d95854e732..cacd695e50d 100644 --- a/source4/libnet/py_net.c +++ b/source4/libnet/py_net.c @@ -103,10 +103,15 @@ static void PyErr_SetDsExtendedError(enum drsuapi_DsExtendedError ext_err, const } } if (error) { - PyErr_SetObject(error, + PyObject *value = Py_BuildValue(discard_const_p(char, "(i,s)"), ext_err, - error_description)); + error
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 8a8286842d8 s4/registry/py: use unsigned ParseTuple format for unsigned value via 7b9d4580e9c s4/messaging/py: use better format strings for variable types via 1e8d0d80d95 s4/librpc/py_misc: ParseTuple format should match actual types via 96cdacae147 s3/libsmb/py: match input argument types with C types via 8294e68a417 py_tevent: add_timer takes float argument from 076f30b0607 winbindd: Enhance xids2sids debugging https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 8a8286842d8770df322c4493632496341d707f0c Author: Douglas Bagnall Date: Thu Feb 7 17:36:02 2019 +1300 s4/registry/py: use unsigned ParseTuple format for unsigned value Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Feb 8 17:09:51 CET 2019 on sn-devel-144 commit 7b9d4580e9cfdd30d4348d6dd6e7333e9b62553f Author: Douglas Bagnall Date: Thu Feb 7 17:34:52 2019 +1300 s4/messaging/py: use better format strings for variable types Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 1e8d0d80d95ff3f9f5f05153d14b24b7122e0d43 Author: Douglas Bagnall Date: Thu Feb 7 17:11:41 2019 +1300 s4/librpc/py_misc: ParseTuple format should match actual types Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 96cdacae1475847fa5005370a4fcb5fcacfb4dbc Author: Douglas Bagnall Date: Thu Feb 7 17:04:43 2019 +1300 s3/libsmb/py: match input argument types with C types If PyArg_ParseTupleAndKeywords() is given, say, an "H" format (meaning unsigned short int) but the referenced variable is a plain unsigned int, the top 16 bits of the variable will be left undefined. In that case we should use an "I" format (and/or initialize the variable). In many cases the change is fairly innocuous, such as when "i" and "I" are mixed (for signed and unsigned ints respectively), but the resulting write is the same size and probably gives the same result in practice. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 8294e68a4175e6116b38869866c42a1b7ba55b6a Author: Douglas Bagnall Date: Thu Feb 7 17:00:28 2019 +1300 py_tevent: add_timer takes float argument We were already using it that way. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: lib/tevent/pytevent.c | 8 ++-- source3/libsmb/pylibsmb.c | 6 +++--- source4/lib/messaging/pymessaging.c | 8 source4/lib/registry/pyregistry.c | 2 +- source4/librpc/ndr/py_misc.c| 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c index 369ec6e02c8..97976df32d3 100644 --- a/lib/tevent/pytevent.c +++ b/lib/tevent/pytevent.c @@ -478,9 +478,13 @@ static PyObject *py_tevent_context_add_timer(TeventContext_Object *self, PyObjec { struct timeval next_event; PyObject *callback; - if (!PyArg_ParseTuple(args, "lO", _event, )) + double secs, usecs; + if (!PyArg_ParseTuple(args, "dO", , )){ return NULL; - + } + next_event.tv_sec = secs; + usecs = (secs - next_event.tv_sec) * 100.0; + next_event.tv_usec = usecs; return py_tevent_context_add_timer_internal(self, next_event, callback); } diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 5f3e6a8c724..da2e5e12d0d 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -856,7 +856,7 @@ static PyObject *py_cli_write(struct py_cli_state *self, PyObject *args, "fnum", "buffer", "offset", "mode", NULL }; if (!ParseTupleAndKeywords( - args, kwds, "I" PYARG_BYTES_LEN "K|I", kwlist, + args, kwds, "i" PYARG_BYTES_LEN "K|I", kwlist, , , , , )) { return NULL; } @@ -1012,7 +1012,7 @@ static PyObject *py_cli_read(struct py_cli_state *self, PyObject *args, "fnum", "offset", "size", NULL }; if (!ParseTupleAndKeywords( - args, kwds, "IKI", kwlist, , , + args, kwds, "iKI", kwlist, , , )) { return NULL; } @@ -1230,7 +1230,7 @@ static PyObject *py_cli_list(struct py_cli_state *self, PyObject *result = NULL; const char *kwlist[] = { "directory", "mask", "attribs", NULL }
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 61670169d52 Clean up reference used with PyDict_Setxxx via 2814690d8fc Cleanup (decref) some objects added to list. via e29c34942dc decref results of PyStr_FromString via 85b7574b91f pidl: Fix Generated ndr python code to DECREF imported modules via 53d973f59c3 Cleanup references to module objects returned from PyImport_ImportModule via 1be9b0cf1bc Examine result of SetList (and prevent sending NULL to PyList_SetItem) via a8e10a12493 Decrement references to python objects passed to Py_BuildValue from bf91ee0a972 tldap: avoid more use after free errors https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 61670169d5241f742bc80bec37b02800af8c8517 Author: Noel Power Date: Thu Jan 31 17:01:26 2019 + Clean up reference used with PyDict_Setxxx PyDictSetxxx methods don't steal reference so if the items added to the dictionary were created just for the purpose of inserting into the dict then we need to decref them. Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Feb 7 17:17:46 CET 2019 on sn-devel-144 commit 2814690d8fc302e79b041b3175e85bef1ac98e51 Author: Noel Power Date: Wed Jan 23 18:43:43 2019 + Cleanup (decref) some objects added to list. PyList_Append doesn't steal references, so if the item created is a temp object, created just to be added to the list we need to decref the item appended in order for it to be released. Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit e29c34942dcc29721f8f3dc8dbb58a18afda1e60 Author: Noel Power Date: Wed Jan 23 18:08:58 2019 + decref results of PyStr_FromString Where we create temporary objects (which are added to containers) these objects already get there ref count incremented. In this case we need to decref those objects to ensure they are released. Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit 85b7574b91f3dfcf751de8ae81876dc64fc5e686 Author: Noel Power Date: Wed Jan 23 17:10:44 2019 + pidl: Fix Generated ndr python code to DECREF imported modules Generated code calls Py_ImportModule but in all error returns and also successful exit the code fails to decrement reference to loaded modules in MODULE_INIT_FUNC function. Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit 53d973f59c3514f9c288cc8e53a682176a5fc415 Author: Noel Power Date: Wed Jan 23 15:15:07 2019 + Cleanup references to module objects returned from PyImport_ImportModule Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit 1be9b0cf1bc95715e83c27eabecbd4fa2022530b Author: Noel Power Date: Fri Jan 25 12:02:50 2019 + Examine result of SetList (and prevent sending NULL to PyList_SetItem) Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit a8e10a12493fdb6b8347b14e157aeb619cf2d2da Author: Noel Power Date: Tue Jan 22 18:26:23 2019 + Decrement references to python objects passed to Py_BuildValue Py_BuildValue when processing format 'O' will 'Pass a Python object untouched (except for its reference count, which is incremented by one' Basically this means if you are using a new reference to a PyObject to pass to BuildValue (to be used with the 'O' format) the reference *isn't* stolen so you really do need to DECREF it in order to ensure it gets cleaned up. Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall --- Summary of changes: auth/credentials/pycredentials.c | 7 +- lib/ldb-samba/pyldb.c| 10 +- lib/ldb/pyldb.c | 79 ++- pidl/lib/Parse/Pidl/Samba4/Python.pm | 18 +- source3/libsmb/pylibsmb.c| 8 +- source3/passdb/py_passdb.c | 437 +-- source4/dns_server/pydns.c | 6 +- source4/dsdb/pydsdb.c| 23 +- source4/lib/policy/pypolicy.c| 18 +- source4/libnet/py_net.c | 12 +- source4/librpc/ndr/py_auth.c | 1 + source4/librpc/ndr/py_security.c | 1 + source4/librpc/ndr/py_xattr.c| 1 + source4/librpc/rpc/pyrpc.c | 30 ++- source4/librpc/rpc/pyrpc_util.c | 7 +- source4/param/provision.c| 23 +- 16 files changed, 453 insertions(+), 228 deletions(-) Changeset truncated at 500 lines: diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index d1ee12e45a9..1b86e001557 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -75,9 +75,10 @@ static PyObject
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6a77237c50d printing: check lp_load_printers() prior to pcap cache update via 0ae7c3144a3 printing: drop pcap_cache_loaded() guard around load_printers() via bdb90ec974b build: replace SAMBA3_ADD_OPTION with samba_add_onoff_option from 545c3e6b124 ldb: Release ldb 1.6.0 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6a77237c50dd258521f356af0b5dc9942dd5592e Author: David Disseldorp Date: Tue Jan 29 01:55:04 2019 +0100 printing: check lp_load_printers() prior to pcap cache update Avoid explicit and housekeeping timer triggered printcap cache updates if lp_load_printers() is disabled. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13766 Signed-off-by: David Disseldorp Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Feb 1 19:25:03 CET 2019 on sn-devel-144 commit 0ae7c3144a30910adb1e54cf46d54d42a1036839 Author: David Disseldorp Date: Tue Jan 29 01:50:15 2019 +0100 printing: drop pcap_cache_loaded() guard around load_printers() Add the pcap_cache_loaded() check to load_printers() and return early if it returns false. This simplifies callers in preparation for checking lp_load_printers() in the printcap cache update code-path. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13766 Signed-off-by: David Disseldorp Reviewed-by: Noel Power commit bdb90ec974b31a6430a2f2329364b01d6f7270c6 Author: David Disseldorp via samba-technical Date: Wed Jan 30 17:13:47 2019 +0100 build: replace SAMBA3_ADD_OPTION with samba_add_onoff_option The former is just an alias for the latter. samba_add_onoff_option() better describes what the function actually does, so use that and remove the alias. Signed-off-by: David Disseldorp Reviewed-by: Noel Power --- Summary of changes: buildtools/wafsamba/samba3.py | 4 +-- source3/printing/load.c| 4 ++- source3/printing/pcap.c| 5 +++ source3/printing/queue_process.c | 6 ++-- source3/printing/spoolssd.c| 8 ++--- source3/wscript| 56 +- source4/dsdb/samdb/ldb_modules/wscript | 2 +- 7 files changed, 42 insertions(+), 43 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba3.py b/buildtools/wafsamba/samba3.py index 5375679c88f..5aab2509b24 100644 --- a/buildtools/wafsamba/samba3.py +++ b/buildtools/wafsamba/samba3.py @@ -2,12 +2,10 @@ # and for SAMBA_ macros for building libraries, binaries etc import os -from waflib import Options, Build +from waflib import Build from samba_utils import os_path_relpath, TO_LIST from samba_autoconf import library_flags -Options.OptionsContext.SAMBA3_ADD_OPTION = Options.OptionsContext.samba_add_onoff_option - def SAMBA3_IS_STATIC_MODULE(bld, module): '''Check whether module is in static list''' if module in bld.env['static_modules']: diff --git a/source3/printing/load.c b/source3/printing/load.c index 51495f970db..7e25d5a91c7 100644 --- a/source3/printing/load.c +++ b/source3/printing/load.c @@ -64,7 +64,9 @@ load automatic printer services from pre-populated pcap cache ***/ void load_printers(void) { - SMB_ASSERT(pcap_cache_loaded(NULL)); + if (!pcap_cache_loaded(NULL)) { + return; + } add_auto_printers(); diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c index 726111816d6..d771cd9dfeb 100644 --- a/source3/printing/pcap.c +++ b/source3/printing/pcap.c @@ -139,6 +139,11 @@ void pcap_cache_reload(struct tevent_context *ev, DEBUG(3, ("reloading printcap cache\n")); + if (!lp_load_printers()) { + DBG_NOTICE("skipping reload - load printers disabled\n"); + return; + } + /* only go looking if no printcap name supplied */ if (pcap_name == NULL || *pcap_name == 0) { DEBUG(0, ("No printcap file name configured!\n")); diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c index 1d60f259a86..7ac609a318a 100644 --- a/source3/printing/queue_process.c +++ b/source3/printing/queue_process.c @@ -172,7 +172,7 @@ static bool printing_subsystem_queue_tasks(struct bq_state *state) /* cancel any existing housekeeping event */ TALLOC_FREE(state->housekeep); - if (housekeeping_period == 0) { + if ((housekeeping_period == 0) || !lp_load_printers()) { DEBUG(4, ("background print queue housekeeping disabled\n")); return true; } @@ -483,9 +483,7 @@ void printing_subs
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ca93b1e15a1 s4/param/provision py_dom_sid_FromSid: avoid python memleak via a3aa5af3d56 s4/pyrpc_util: catch alloc failure in py_dcerpc_interface_init_helper() via e23b9f88cc1 s4/pyrpc_util: appropriately decrement refcounts on failure via 3584fe46d92 s3/py_passdb: maintain correct refcount on allocation failure via 1f07c478ec1 python/modules: maintain correct refcount for path items from e1324580391 tests: don't rely on implicit int return type https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ca93b1e15a1c0606fe7e2d149af30cc0168fdb7b Author: Douglas Bagnall Date: Thu May 3 09:59:13 2018 +1200 s4/param/provision py_dom_sid_FromSid: avoid python memleak Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jan 29 16:54:48 CET 2019 on sn-devel-144 commit a3aa5af3d5600b510a3289c5ab16610263f26c4f Author: Douglas Bagnall Date: Thu May 3 09:57:29 2018 +1200 s4/pyrpc_util: catch alloc failure in py_dcerpc_interface_init_helper() Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit e23b9f88cc1c8a8c8cda07fb25d639218c12d91a Author: Douglas Bagnall Date: Thu May 3 09:53:56 2018 +1200 s4/pyrpc_util: appropriately decrement refcounts on failure Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 3584fe46d92037c1fb9825d7d25ecc9bdd60c0f4 Author: Douglas Bagnall Date: Thu May 3 09:39:18 2018 +1200 s3/py_passdb: maintain correct refcount on allocation failure Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power commit 1f07c478ec1823c322b0de4db1a51029de8e5056 Author: Douglas Bagnall Date: Thu May 3 10:45:39 2018 +1200 python/modules: maintain correct refcount for path items Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- Summary of changes: python/modules.c| 29 +++-- source3/passdb/py_passdb.c | 6 ++ source4/librpc/rpc/pyrpc_util.c | 27 +++ source4/param/provision.c | 10 ++ 4 files changed, 58 insertions(+), 14 deletions(-) Changeset truncated at 500 lines: diff --git a/python/modules.c b/python/modules.c index 5db3dd348e2..ae91b0939ae 100644 --- a/python/modules.c +++ b/python/modules.c @@ -25,16 +25,20 @@ static bool PySys_PathPrepend(PyObject *list, const char *path) { + bool ok; PyObject *py_path = PyStr_FromString(path); - if (py_path == NULL) + if (py_path == NULL) { return false; - - return (PyList_Insert(list, 0, py_path) == 0); + } + ok = PyList_Insert(list, 0, py_path) == 0; + Py_XDECREF(py_path); + return ok; } bool py_update_path(void) { - PyObject *mod_sys, *py_path; + PyObject *mod_sys = NULL; + PyObject *py_path = NULL; mod_sys = PyImport_ImportModule("sys"); if (mod_sys == NULL) { @@ -43,22 +47,27 @@ bool py_update_path(void) py_path = PyObject_GetAttrString(mod_sys, "path"); if (py_path == NULL) { - return false; - } + goto error; + } if (!PyList_Check(py_path)) { - return false; + goto error; } if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) { - return false; + goto error; } if (strcmp(dyn_PYTHONARCHDIR, dyn_PYTHONDIR) != 0) { if (!PySys_PathPrepend(py_path, dyn_PYTHONARCHDIR)) { - return false; + goto error; } } - + Py_XDECREF(py_path); + Py_XDECREF(mod_sys); return true; +error: + Py_XDECREF(py_path); + Py_XDECREF(mod_sys); + return false; } diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index 1b4ec3d531e..2ac2942a47f 100644 --- a/source3/passdb/py_passdb.c +++ b/source3/passdb/py_passdb.c @@ -3945,6 +3945,7 @@ MODULE_INIT_FUNC(passdb) dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(mod, "dom_sid"); if (dom_sid_Type == NULL) { + Py_DECREF(mod); talloc_free(frame); return NULL; } @@ -3953,6 +3954,7 @@ MODULE_INIT_FUNC(passdb) security_Type = (PyTypeObject *)PyObject_GetAttrString(mod, "descriptor"); Py_DECREF(mod); if (security_Type == NULL) { + Py_DECREF(dom_sid_Type); talloc_free(frame); return NULL; } @@ -3960,6 +3962,8 @@ MODULE_INIT_FUNC(passdb) /* Import GUID type from dcerpc.misc */ mod =
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 10e54a095f0 netcmd: Try to improve domain backup error message from 0628ca2a558 tdb: Fix compatibility of wscript with older python https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 10e54a095f005c0988a7e5e8a35cea6200197854 Author: Tim Beale Date: Thu Jan 17 09:41:21 2019 +1300 netcmd: Try to improve domain backup error message I ran this command as non-root by mistake and didn't find the error message particularly helpful. Tweak the error message so it reminds the user that they should be root. Also display the path we're looking for the sam.ldb file in, to give them more clues. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Jan 21 16:34:06 CET 2019 on sn-devel-144 --- Summary of changes: python/samba/netcmd/domain_backup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/netcmd/domain_backup.py b/python/samba/netcmd/domain_backup.py index 4cacf571f3d..4e32b4b9b1c 100644 --- a/python/samba/netcmd/domain_backup.py +++ b/python/samba/netcmd/domain_backup.py @@ -1009,8 +1009,9 @@ class cmd_domain_backup_offline(samba.netcmd.Command): paths = samba.provision.provision_paths_from_lp(lp, lp.get('realm')) if not (paths.samdb and os.path.exists(paths.samdb)): -raise CommandError('No sam.db found. This backup ' + - 'tool is only for AD DCs') +logger.error("No database found at {0}".format(paths.samdb)) +raise CommandError('Please check you are root, and ' + + 'are running this command on an AD DC') check_targetdir(logger, targetdir) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 36ff1a51266 netcmd: Fix broken samba-tool gpo commands from d7d3ee18a59 statvfs: fix bsize and frsize mixup https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 36ff1a5126605e14c3a77337b654c95c668c573a Author: Tim Beale Date: Thu Jan 10 16:34:27 2019 +1300 netcmd: Fix broken samba-tool gpo commands samba-tool gpo create|fetch|backup commands throw exceptions due to a missing Python import: ERROR(): uncaught exception - name 'tempfile' is not defined File "bin/python/samba/netcmd/__init__.py", line 184, in _run return self.run(*args, **kwargs) File "bin/python/samba/netcmd/gpo.py", line 980, in run tmpdir, gpodir = self.construct_tmpdir(tmpdir, gpo) File "bin/python/samba/netcmd/gpo.py", line 386, in construct_tmpdir tmpdir = tempfile.mkdtemp() Introduced by commit e3320b6d3df7a0c7b refactor. Signed-off-by: Tim Beale Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Jan 10 16:21:23 CET 2019 on sn-devel-144 --- Summary of changes: python/samba/netcmd/gpo.py | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py index b65fb7c042c..a064f44147a 100644 --- a/python/samba/netcmd/gpo.py +++ b/python/samba/netcmd/gpo.py @@ -25,6 +25,7 @@ import ldb import re import xml.etree.ElementTree as ET import shutil +import tempfile from samba.auth import system_session from samba.netcmd import ( -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 08867de2efd s3:utils:net: Print debug message about Netbios via ecbb2f78cec s3:smbpasswd: Print debug message about Netbios via 499f051c9d5 s3:libsmb: Print debug message about Netbios via 78f51a1d3c5 s3:libsmb: Check disable_netbios in socket connect from a9def5c6971 s3:libsmb: Revert SMB Py bindings name back to libsmb_samba_internal https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 08867de2efde05e4730b41a335d13f775e44e397 Author: Justin Stephenson Date: Mon Dec 17 15:17:24 2018 -0500 s3:utils:net: Print debug message about Netbios With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson Reviewed-by: Noel Power Reviewed-by: Jeremy Allison Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Jan 9 22:38:21 CET 2019 on sn-devel-144 commit ecbb2f78cec6d9e6f5180c8ba274a1da2152f098 Author: Justin Stephenson Date: Mon Dec 17 14:57:59 2018 -0500 s3:smbpasswd: Print debug message about Netbios With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson Reviewed-by: Noel Power Reviewed-by: Jeremy Allison commit 499f051c9d527a14f9712365f8403a1ee0662c5b Author: Justin Stephenson Date: Mon Dec 17 14:40:33 2018 -0500 s3:libsmb: Print debug message about Netbios With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson Reviewed-by: Noel Power Reviewed-by: Jeremy Allison commit 78f51a1d3c53248159c1e7643364b62e52457bb9 Author: Justin Stephenson Date: Thu Jan 3 12:07:01 2019 -0500 s3:libsmb: Check disable_netbios in socket connect If the disable_netbios option is set then return NT_STATUS_NOT_SUPPORTED for a port 139 connection in the low level socket connection code. Signed-off-by: Justin Stephenson Reviewed-by: Noel Power Reviewed-by: Jeremy Allison --- Summary of changes: source3/libsmb/clidfs.c | 4 source3/libsmb/libsmb_server.c | 4 source3/libsmb/passchange.c | 16 source3/libsmb/smbsock_connect.c | 5 + source3/utils/net_rpc.c | 3 +++ source3/utils/net_time.c | 9 +++-- 6 files changed, 35 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 6918802396c..4342a3b1d1b 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -196,6 +196,10 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx, flags, ); if (!NT_STATUS_IS_OK(status)) { + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + DBG_ERR("NetBIOS support disabled, unable to connect"); + } + DBG_WARNING("Connection to %s failed (Error %s)\n", server, nt_errstr(status)); diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index 67dfcf72327..0067df48cac 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -489,6 +489,10 @@ SMBC_server_internal(TALLOC_CTX *ctx, } if (!NT_STATUS_IS_OK(status)) { + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + DBG_ERR("NetBIOS support disabled, unable to connect"); + } + errno = map_errno_from_nt_status(status); return NULL; } diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index 48ffba8036f..f60e3079975 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -46,10 +46,18 @@ NTSTATUS remote_password_change(const char *remote_machine, result = cli_connect_nb(remote_machine, NULL, 0, 0x20, NULL, SMB_SIGNING_IPC_DEFAULT, 0, ); if (!NT_STATUS_IS_OK(result)) { - if (asprintf(err_str, "Unable to connect to SMB server on " -
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fe7ab7d5132 tests/ntlm_auth: Port ntlm_auth_diagnostics tests to python via 4846d4a7136 selftest: Remove test_ntlm_auth.py helper via 129ab34baf0 tests/ntlm_auth: Port ntlm_auth_krb5 tests to python via 91c4f260360 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with incorrect fixed password against winbind via 3ae7095bbee tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with plaintext password against winbind but wrong sid via 8d4258f43de tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with plaintext password against winbind via 7c0c683b2ea tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with incorrect fixed password via 28ea2f7220d tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with fixed password via 3794c1c5274 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth plaintext authentication with failed require-membership-of via dfa149276f1 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth plaintext authentication with require-membership-of via caa505302f5 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth with NTLMSSP gss-spnego-client and gss-spnego server against winbind with failed require-membership-of via 377e87a2347 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth against winbindd with failed require-membership-of via 8d11a54e370 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth with NTLMSSP gss-spnego-client and gss-spnego server against winbind with require-membership-of via 1f704496ea6 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth against winbindd with require-membership-of via 06d101e3f08 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ccached credentials with NTLMSSP client and gss-spnego server via 4ce9371f5fa tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth with NTLMSSP gss-spnego-client and gss-spnego server against winbind via c9a5bf3c82c tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth with NTLMSSP gss-spnego-client and gss-spnego server via d3fd3d01f19 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth with NTLMSSP client and gss-spnego server via 4a11ab373b3 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth against winbindd via 247592f7162 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth and ntlm_auth with specified domain via e8144129111 selftest: Add a new base class for ntlm_auth tests via d0b5e216b07 selftest: Create included files during provision from b1ad5a880fd krb5_wrap: Fix bit shifting https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fe7ab7d5132b2312f617b3c51db9d4c9f9271a51 Author: Samuel Cabrero Date: Thu Sep 6 13:56:53 2018 +0200 tests/ntlm_auth: Port ntlm_auth_diagnostics tests to python Port ntlm_auth_diagnostics bash script tests to python Signed-off-by: Samuel Cabrero Reviewed-by: Noel Power Reviewed-by: Andrew Bartlett Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Dec 19 16:21:32 CET 2018 on sn-devel-144 commit 4846d4a713679957f31b8da179be192d8b6e7506 Author: Samuel Cabrero Date: Thu Nov 15 11:17:43 2018 +0100 selftest: Remove test_ntlm_auth.py helper Signed-off-by: Samuel Cabrero Reviewed-by: Noel Power Reviewed-by: Andrew Bartlett commit 129ab34baf0b1554dea3d93506b95439bffcb30f Author: Samuel Cabrero Date: Thu Sep 6 12:58:42 2018 +0200 tests/ntlm_auth: Port ntlm_auth_krb5 tests to python Port ntlm_auth_krb5 bash script tests to python Signed-off-by: Samuel Cabrero Reviewed-by: Noel Power Reviewed-by: Andrew Bartlett commit 91c4f2603607a917c1f1006b2f9f83232ac489c4 Author: Samuel Cabrero Date: Fri Aug 31 19:28:06 2018 +0200 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with incorrect fixed password against winbind Port ntlm_auth bash script tests to python and remove bash test script Signed-off-by: Samuel Cabrero Reviewed-by: Noel Power Reviewed-by: Andrew Bartlett commit 3ae7095bbee9ca19056c00a61084d49e5e278728 Author: Samuel Cabrero Date: Fri Aug 31 19:27:20 2018 +0200 tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with plaintext password against winbind but wrong sid Port ntlm_auth bash script tests to python Signed-off-by: Samuel Cabrero Reviewed-by: Noel Power Reviewed-by: Andrew Bartlett commit 8d4258f43dea153cc60a6b9dbd36f0ca0b5abf0e Author: Samuel Cabrero Date: Fri Aug 31 19:15:05 2018 +0200 tests/ntlm_auth: Port ntlm_auth tests
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via edfb6cb8223 PY3: change shebang to python3 in misc dirs via a07279b78a8 PY3: change shebang to python3 in lib dir via c65a70781da PY3: change shebang to python3 in wintest dir via 9d8e35ab97c PY3: change shebang to python3 in script dir via 8e3c194453f PY3: change shebang to python3 in source4/dsdb dir via 338413ad5ab PY3: change shebang to python3 in source4/scripting dir via 359d832e898 PY3: change shebang to python3 in source4/torture dir via a19d5bd771c PY3: change shebang to python3 in source4/scripting/bin dir via 934e336a951 s3:test: make sids2xids test compatible with py2 and py3 via 5ddff307b4a build: Move python detection back into waf (instead of in configure and Makefile) from 31957c7fe9d audit_logging: auth_json_audit required auth_json https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit edfb6cb8223be430360c8372457880471a198630 Author: Joe Guo Date: Wed Dec 12 13:43:21 2018 +1300 PY3: change shebang to python3 in misc dirs Signed-off-by: Joe Guo Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Dec 14 18:00:40 CET 2018 on sn-devel-144 commit a07279b78a83d7e62eb0c58a2ac989407a40fb6b Author: Joe Guo Date: Wed Dec 12 13:41:58 2018 +1300 PY3: change shebang to python3 in lib dir Signed-off-by: Joe Guo Reviewed-by: Noel Power commit c65a70781da987b4ea445b3ad79784b508170bf5 Author: Joe Guo Date: Wed Dec 12 13:37:10 2018 +1300 PY3: change shebang to python3 in wintest dir Signed-off-by: Joe Guo Reviewed-by: Noel Power commit 9d8e35ab97c0e613761136a3495515b18c85a157 Author: Joe Guo Date: Wed Dec 12 13:18:40 2018 +1300 PY3: change shebang to python3 in script dir Signed-off-by: Joe Guo Reviewed-by: Noel Power commit 8e3c194453f206152b40fa7a5efb1436b13424e9 Author: Joe Guo Date: Wed Dec 12 13:40:43 2018 +1300 PY3: change shebang to python3 in source4/dsdb dir Signed-off-by: Joe Guo Reviewed-by: Noel Power commit 338413ad5aba0b6fa2f0419eb99b4d00ebf6ebc7 Author: Joe Guo Date: Wed Dec 12 13:39:24 2018 +1300 PY3: change shebang to python3 in source4/scripting dir Signed-off-by: Joe Guo Reviewed-by: Noel Power commit 359d832e8981bce350cd7f1d9b087baa57e47cd7 Author: Joe Guo Date: Wed Dec 12 13:38:33 2018 +1300 PY3: change shebang to python3 in source4/torture dir Signed-off-by: Joe Guo Reviewed-by: Noel Power commit a19d5bd771c1727b037d28d24af0b85e49bdafb2 Author: Joe Guo Date: Tue Dec 11 12:23:17 2018 +1300 PY3: change shebang to python3 in source4/scripting/bin dir Samba default python is 3 now. Signed-off-by: Joe Guo Reviewed-by: Noel Power commit 934e336a951a9e6eea00dee9a74059f6a9a37224 Author: Joe Guo Date: Thu Dec 13 16:33:40 2018 +1300 s3:test: make sids2xids test compatible with py2 and py3 define a wrapper function for subprocess.check_output, to return bytes for py2 and unicode for py3, and replace Popen with it. Signed-off-by: Joe Guo Reviewed-by: Noel Power commit 5ddff307b4af5c82d5064745f5bd2c33bd340ced Author: Andrew Bartlett Date: Wed Dec 12 07:10:30 2018 +1300 build: Move python detection back into waf (instead of in configure and Makefile) This avoids creating a mini-configure in the configure script. Users wishing to use python2 to build need to specify PYTHON= to both ./configure and make After we merged the python3 change, it became clear that relying on systems prefixing the correct python just causes trouble and make debugging harder, so only use $PYTHON for the override, not the default case This essentially reverts a660b7fb8e519bd3be558fd0425bff8f287fca1f but leaves the files more consistent. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power --- Summary of changes: Makefile | 1 - auth/credentials/tests/bind.py | 2 +- buildtools/bin/waf | 2 +- buildtools/examples/run_on_target.py | 2 +- configure | 2 +- ctdb/Makefile | 1 - ctdb/configure | 2 +- examples/logon/ntlogon/ntlogon.py | 2 +- lib/ldb-samba/tests/match_rules.py | 2 +- lib/ldb/Makefile | 1 - lib/ldb/configure | 2 +- lib/ldb/tests/python/api.py| 2 +- lib/ldb/tests/python/index.py | 2 +- lib/replace
[SCM] Samba Shared Repository - branch master updated
Y3: wrap filter calls with list where list is expected via a25bd836ee6 python/samba/tests: PY3 port samba.tests.dns via 0d73a2b0a29 PY3: net.change_password & net.set_password take string not bytes via d253e84a41b python/samba: PY3 Credential.set_password takes string via 9b18748c703 auth/credentials: PY3 set_password should decode from unicode 'utf8' via 8b10c713716 python/samba: Py3 Use new compat.sockerserver symbol via fdf2deb3ba1 python/samba: PY3 compat py2/p3 symbol for SocketServer/socketserver via 1fb9887ea87 python/samba: PY3 ord needs 'str' type not int via 351ca11b064 s4/setup/tests: make sure samba-tool is called with correct py version via 3519fcb9b79 s4/utils/test: PY3 make sure we call correct python version for samba-tool via 277dbd9cffb nsswitch/tests: PY3 samba_tool call correct python via af8077e807d testprogs/blackbox: make sure samba-tool is called with correct python via 6e46d9770ed python/samba.tests: Ensure samba-tool is called with correct python ver. from 7d271450f71 ctdb: Remove parameter from pfetch usage info https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f7516971b566f6099abcaf4e6ad42102cc6c9b07 Author: Noel Power Date: Mon Dec 10 07:36:15 2018 + CI: Adjust CI tasks for new python3 autobuild.py default Now that autobuild has defaulted to python3 (via shebang) we no longer need to explicity call autobuild.py with 'python3' Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Dec 10 14:32:24 CET 2018 on sn-devel-144 commit bc92277a79bd393b9e1389e0069e4a4725675eff Author: Noel Power Date: Mon Dec 10 07:28:31 2018 + autobuild: We should run autobuild with python3 by default sn-devel autobuild runing autobuild.py (via git hooks I suppose) but if run directly (e.g. depending on script shebang) then 'python' aka python2 will run. This will cause an error when building some targets because the autobuild script itself sometimes builds paths based on the version of python executing the script e.g ${PYTHON_PREFIX}. Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit 9ac432d4bc5b57660204aace375a32d58ac076df Author: Noel Power Date: Mon Dec 3 17:08:51 2018 + selftest/flapping.d: Add python2 versions for flapping tests Post build & test running under python3 we now run with '--extra-python=/usr/bin/python2', these tests will get python2 appended to the test name so we need also to create new flapping*/* entries for these. We will keep the python3 versions in case we create some CI job(s) with PYTHON=python configure.developer --extra-python=/usr/bin/python3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit 35aef220ceb16eea7c495c3c105c0ff02146ea3e Author: Noel Power Date: Fri Nov 30 14:36:14 2018 + selftest/knownfail: Add python2 version of known fails Post build & test running under python3 we now run with '--extra-python=/usr/bin/python2', these tests will get python2 appended to the test name so we need also to create new knownfails for these. We will keep the python3 versions in case we create (and we probably should) some CI job(s) with PYTHON=python configure.developer --extra-python=/usr/bin/python3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit 5a804050717e9e885c6354ffacac7827236c81e4 Author: Noel Power Date: Thu Nov 29 21:28:11 2018 + CI: Add new py2 CI jobs to replace old py3 ones Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit b0b9c62e1cfcadb1189559e3b4834f2b4a053f8a Author: Noel Power Date: Thu Nov 29 21:21:58 2018 + autobuild: Convert old py3 tasks to py2 Now that we are building with python3 by default we need to convert the old python3 test tasks to python2 (e.g. reverse how we used do it) Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit e3c37bbad4f45124a4ae7316a67e4c223e16faf1 Author: Noel Power Date: Thu Nov 29 21:18:07 2018 + selftest: don't hardcode '.python3' for extra-python tests Instead of hardcoding '.python3' we now hardcode the extra python exe (which will be python2 for a default python3 build) Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit 2fb74e6ad32db46d907bb75ea35107c0e348ed78 Author: Noel Power Date: Thu Nov 29 16:51:50 2018 + buildtools/wafsamba: Support --extra-python with python2 Relax restriction on extra_python version Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett commit dfe5787c255eaab3d8022c972a1afa1dd83e62e
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e355a6b s4/selftest: enable samba.tests.samba_tool.gpo for PY3 via fc047c2 python/samba/gp_parse: PY2/PY3 Decode only when necessary via 6476ef5 python/samba/tests/samba_tool: PY2/PY3 compat port for test via 1659684 python/samba/gp_parse: Fix mulitple encode step with write_section via 19a459b python/samba/netcmd: misc PY2/PY3 compat changes for gpo.py via 54e2bb7 python/samab/gp_parse: remove unused code via df578e1 python/samba/gp_parse: Use csv.reader for parsing cvs files via cf79e6a python/samba/gp_parse: PY2/PY3 compat porting for gp_init.py via d40ef73 python/samba/gp_parse: PY3 open file non-binary mode for write_binary via 388bddf python/samba/gp_parse: PY3 file -> open via 0934fc1 python/samba/gp_parse: PY2/PY3 compat changes for __init__.py from 27df4f0 ctdb-recovery: Ban a node that causes recovery failure https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e355a6bc59624f9328a6dbf33b335c57e9c8e10f Author: Noel Power Date: Tue Sep 4 20:33:35 2018 +0100 s4/selftest: enable samba.tests.samba_tool.gpo for PY3 Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Nov 5 23:04:48 CET 2018 on sn-devel-144 commit fc047c2cf458e08e2689ff27677d8622f4507c82 Author: Noel Power Date: Wed Sep 5 17:01:17 2018 +0100 python/samba/gp_parse: PY2/PY3 Decode only when necessary In python2 we decode str types in load_xml, in python3 these are str class(s) which we cannot decode. Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit 6476ef589ee093640e93f6c673b432fcab576888 Author: Noel Power Date: Wed Sep 5 16:14:32 2018 +0100 python/samba/tests/samba_tool: PY2/PY3 compat port for test Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit 16596842a62bec0a9d974c48d64000e3c079254e Author: Noel Power Date: Wed Sep 5 15:23:01 2018 +0100 python/samba/gp_parse: Fix mulitple encode step with write_section In python2 as far as I can see GptTmplInfParser.write_binary more or less works by accident. write_binary creates a writer for the 'utf8' codec, such a writer should consume unicode and emit utf8 encoded bytes. This writer is passed to each of the sections managed by GptTmplInfParser as follows def write_binary(self, filename): with codecs.open(filename, 'wb+', self.encoding) as f: for s in self.sections: self.sections[s].write_section(s, f) And each section type itself is encoding its result to 'utf-16-le' e.g. class UnicodeParam(AbstractParam): def write_section(self, header, fp): fp.write(u'[Unicode]\r\nUnicode=yes\r\n'.encode(self.encoding) But this makes little sense, it seems like sections are encoded to one encoding but the total file is supposed to be encoded as ut8??? Also having an encoding per ParamType doesn't seem correct. Bizarely in PY2 this works and it actually encodes the whole file as utf-16le In PY3 you can't do this as the writer wants to deal with strings not bytes (after the extra encode phase in 'write_section'. So, changes here are to remove the unnecessary encoding in each 'write_section' method, additionally in GptTmplInfParser.write_binary the codecs.open call now uses the correct codec (e.g. 'utf-16-le') to write Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit 19a459bac3932427afc65661d06dd7a6eda8865e Author: Noel Power Date: Wed Sep 5 14:54:24 2018 +0100 python/samba/netcmd: misc PY2/PY3 compat changes for gpo.py Fixes: 1) various ldb.bytes that should be displayed as strings in PY3 2) sorting of lists of xml Element in PY3 3) various 'open' need to be opened in binary mode (to accept binary data) Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit 54e2bb707bc998e9017ab3818f8df45c95fad3ce Author: Noel Power Date: Wed Sep 5 14:39:11 2018 +0100 python/samab/gp_parse: remove unused code Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall commit df578e1554630f6781d40d4820c9026bb7b01d2d Author: Noel Power Date: Wed Sep 5 14:18:16 2018 +0100 python/samba/gp_parse: Use csv.reader for parsing cvs files The previous version here was using UnicodeReader which was wrapping the UTF8Recoder class and passing that to csv.reader. It looks like the intention was to read a bytestream in a certain encoding and then reencode it to a different encoding. And then UnicodeReader creates unicode from the newly encoded str
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via adf73d3 pytests/samba3sam: unshadow and fix a search_non_mapped test via 654cc08 python/tests/ou: unshadow a test via add4068 samba-tool tests: fix bytes/str issue in masked test via 99be8e9 python/tests/raw_protocol: reveal shadowed test via disambiguation via 3117279 s4/dsdb/pytest/ldap_schema: remove duplicate test via d2fadfd ldb/tests/py/api: reveal shadowed casefold test via d042a30 python/tests/kcc_utils: disambiguate/unshadow a test via 03f4565 python/tests/lsa_string: remove duplicate method via f12fd90 python/gp_parse/gp_inf: remove unused variables via bab4f3a python/gp_parse/gp_inf: remove shadowed method via 105e14c s4/scripting/demodirsync: fix syntax error via 6ab7a3b s4/scripting: py3 style 0o123 octal, not 0123 via 4fdccc0 s4/dsdb/pytest/sort: use compat.cmp_fn instead of cmp via d121c68 s4/dsdb/pytest/ad_dc_medley: do not use xrange via 41844d1 s4/dsdb/pytests: Py3 compatitble except clauses via cd5ac17 script/show_test_time: approach python 3 compatibility via 159fdcb python/kcc: use compat.cmp_fn (PY3) via d6072cb python/remove_dc: use a local variable in offline_remove_server via 71825bc python/samba/common: py3 compat raw_input via bc8201b samba-tool ldapcmp: use ValueError, not obsolete StandardError via 2412ca5 python tests: always use Python's unicodedata via a1450f2 pytest/dcerpc.integer: force py2 long int without incompatible syntax via 91bab6f s4/selftest/tests: don't use import * via 9f7247d s3/selftest/tests: don't use import * via 8818b21 selftest/tests.py: avoid import * via c9c3a9c python/tests/common: avoid import * via aff2afd selftest/perftests: avoid import * via bbf1740 python/tests/kcc_*: avoid * imports via b90b2fc python/tests/kcc.graph: avoid import * via e9a57a5 s4/scripting/pfm_verify: remove duplicate import via da9fe70 samba-tool: samba.getopt is not used here via 3d5ba7f auth/cred/tests/bind: remove unused import via 86aca4d s4/dsdb/pytest/: unused imports via 682b223 s4/dsdb/pytest/dsdb_schema_info: do not double import via 742c786 s4/dsdb/pytest/dirsync: do not double import via ff1bff9 py/tests: remove unused imports via cb2c584 tests/blackbox/py: remove unused imports via 87272cf tdb/test/_tdbtext: remove unused imports via 02ed259 talloc/test/pytalloc: remove unused imports via eef11c4 ldb/tests/_ldb_text: remove unused imports via 6b88685 ldb-samba/tests/match-rules: remove unused imports via dd99bfd wintest/test-s3: remove unused imports via 5773290a script/generate_param.py: remove unused imports via 68b284f python/tests: remove unused imports via 135a3c2 python/tests/samdb: avoid useless local variable via b9161e5 python/tests/*: remove unused imports via eac8523 python/tests/netbios: remove unused imports via 4fc99a0 python/tests/getdcname: remove unused imports via 0c18c37 python/tests/dsdb_schema_attr: remove unused/duplicate imports via 018c013 python/tests/dns*: remove unused imports via f5df55d python/provision: remove unused imports via 1ecdde4 python/gp_parse/gp_pol: remove unused import via 9d24ded python/schema: remove unused import via 8519502 python/ntacls: remove unused imports via 74a5448 python/gp_ext_loader: remove unused imports via daea7c1 python/forest_update: remove unused imports via db6ab2c python/domain_update: remove unused imports via fe6daff samba-tool domain: remove unused imports via c3b5326 samba-tool user: remove unused import via ca40183 samba-tool ldapcmp: remove unused import via 24a3acb samba-tool drs: remove duplicate and unused imports via 2ce9890 python/tests/__init__: import what we need via 3f56dc1 python/tests/gpo: import what we need (errno, not gp_log) via b3e913e python/tests/unix: fix spelling and import of text_type from a03804c s3:smbd: Move a variable declaration closer to its use https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit adf73d34a3e51c2a3ce93f144cd898423e190236 Author: Douglas Bagnall Date: Fri Oct 12 11:52:49 2018 +1300 pytests/samba3sam: unshadow and fix a search_non_mapped test Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Oct 26 00:50:37 CEST 2018 on sn-devel-144 commit 654cc08cf0e31478463bb4bfdc95623a990ac88d Author: Douglas Bagnall Date: Thu Oct 11 14:45:58 2018 +1300 python/tests/ou: unshadow a test Signed-off-by: Douglas
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e5298c8 uid_wrapper: Fix Tab/indent error with python3 from 8b4ec1c docs: Add gpfs:check_fstype to vfs_gpfs manpage https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e5298c8bc1221f4f02ac1c1d7fd6de7a2b95af97 Author: Noel Power Date: Mon Sep 17 14:17:25 2018 +0200 uid_wrapper: Fix Tab/indent error with python3 Signed-off-by: Noel Power Reviewed-by: Andreas Schneider Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Sep 19 17:49:33 CEST 2018 on sn-devel-144 --- Summary of changes: third_party/uid_wrapper/wscript | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/third_party/uid_wrapper/wscript b/third_party/uid_wrapper/wscript index b1dc379..61d8a18 100644 --- a/third_party/uid_wrapper/wscript +++ b/third_party/uid_wrapper/wscript @@ -59,13 +59,13 @@ def configure(conf): addmain=False, strict=True, msg='Checking for printf format validation support') - # Prototype checks - conf.CHECK_C_PROTOTYPE('setgroups', - 'int setgroups(int ngroups, const gid_t *grouplist)', - define='HAVE_SETGROUPS_INT', headers='unistd.h sys/types.h') - conf.CHECK_C_PROTOTYPE('syscall', - 'int syscall(int number, ...)', - define='HAVE_SYSCALL_INT', headers='unistd.h sys/syscall.h') +# Prototype checks +conf.CHECK_C_PROTOTYPE('setgroups', +'int setgroups(int ngroups, const gid_t *grouplist)', +define='HAVE_SETGROUPS_INT', headers='unistd.h sys/types.h') +conf.CHECK_C_PROTOTYPE('syscall', +'int syscall(int number, ...)', +define='HAVE_SYSCALL_INT', headers='unistd.h sys/syscall.h') if (sys.platform.rfind('linux') > -1): conf.CHECK_CODE(''' -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4a63ab9 s4/selftest/tests: Enabled samba.tests.samba_tool.computer via 2200b22 s4/dsdb/tests: port samba4.tombstone_reanimation for PY3 via 59ff17c s3/selftst: enable samba4.tombstone_reanimation for py3 via d18c9dc s4/selftest: enable samba4.drs.replica_sync_rodc.python for py3 via 2b4d281 s4/torture/drs: PY3 port for samba4.drs.replica_sync_rodc via 7b4db74 s4/selftest: enable samba.tests.dsdb_schema_attributes for py3 via e5afa01 python/samba/tests: port samba.tests.dsdb_schema_attributes to PY3 from 8c2c979 PEP8: fix E128: continuation line under-indented for visual indent https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4a63ab95ca4240cdb808c189c29b5b3809270041 Author: Noel Power Date: Thu Apr 26 18:23:50 2018 +0100 s4/selftest/tests: Enabled samba.tests.samba_tool.computer Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org Autobuild-User(master): Noel Power Autobuild-Date(master): Thu Sep 6 19:24:54 CEST 2018 on sn-devel-144 commit 2200b22b345213539d49d374731cf076a8ce4a70 Author: Noel Power Date: Mon Sep 3 18:47:20 2018 +0100 s4/dsdb/tests: port samba4.tombstone_reanimation for PY3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org commit 59ff17cc75b675d22b2e46e25da125b83f274c26 Author: Noel Power Date: Thu May 10 18:17:29 2018 +0100 s3/selftst: enable samba4.tombstone_reanimation for py3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org commit d18c9dc61cb0c78ce2a0dc72c716fa75fd1ab119 Author: Noel Power Date: Thu May 10 17:19:47 2018 +0100 s4/selftest: enable samba4.drs.replica_sync_rodc.python for py3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org commit 2b4d2810eb8017866816069d37fd2f48790e8055 Author: Noel Power Date: Mon Sep 3 17:56:56 2018 +0100 s4/torture/drs: PY3 port for samba4.drs.replica_sync_rodc Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org commit 7b4db7464222378642dd61a66e80d5f168119ee3 Author: Noel Power Date: Thu May 10 16:35:29 2018 +0100 s4/selftest: enable samba.tests.dsdb_schema_attributes for py3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org commit e5afa011fd7d5000f5b25ce31478c751e8144f6d Author: Noel Power Date: Mon Sep 3 17:34:27 2018 +0100 python/samba/tests: port samba.tests.dsdb_schema_attributes to PY3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett abart...@samba.org --- Summary of changes: python/samba/drs_utils.py | 2 +- python/samba/tests/dsdb_schema_attributes.py | 12 ++-- source4/dsdb/tests/python/tombstone_reanimation.py | 18 +- source4/selftest/tests.py | 9 + source4/torture/drs/python/replica_sync_rodc.py| 3 ++- 5 files changed, 27 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/drs_utils.py b/python/samba/drs_utils.py index 7573b62..05a9df7 100644 --- a/python/samba/drs_utils.py +++ b/python/samba/drs_utils.py @@ -168,7 +168,7 @@ def drs_get_rodc_partial_attribute_set(samdb): "searchFlags"]) for r in res: -ldap_display_name = r["lDAPDisplayName"][0] +ldap_display_name = str(r["lDAPDisplayName"][0]) if "systemFlags" in r: system_flags = r["systemFlags"][0] if (int(system_flags) & (samba.dsdb.DS_FLAG_ATTR_NOT_REPLICATED | diff --git a/python/samba/tests/dsdb_schema_attributes.py b/python/samba/tests/dsdb_schema_attributes.py index b13712c..d27cc07 100644 --- a/python/samba/tests/dsdb_schema_attributes.py +++ b/python/samba/tests/dsdb_schema_attributes.py @@ -104,7 +104,7 @@ systemOnly: FALSE self.assertIn(attr_ldap_name, attr_res[0]) self.assertEquals(len(attr_res[0][attr_ldap_name]), 1) -self.assertEquals(attr_res[0][attr_ldap_name][0], "CASE_INSENSITIVE") +self.assertEquals(str(attr_res[0][attr_ldap_name][0]), "CASE_INSENSITIVE") # Check @INDEXLIST @@ -127,7 +127,7 @@ systemOnly: FALSE self.assertIn(attr_ldap_name, attr_res[0]) self.assertEquals(len(attr_res[0][attr_ldap_name]), 1) -self.assertEquals(attr_res[0][attr_ldap_name][0], "CASE_INSENSITIVE") +self.assertEquals(str(attr_res[0][attr_ldap_name][0]), "CASE_INSENSITIVE") # Check @INDEXLIST @@ -160,11 +160,11 @@ systemOnly: FALSE self.assertIn(attr_ldap_name, attr_res[0])
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e053aad s3/utils: fix regression where specifying -Unetbios/root works via 705086d s3/smbd: allow set quota for non root user (when built with --enable-selftest) via 801c185 s3/script/tests: Add simple (smb1 & smb2) get/set/list tests for smbcquotas via 90da2e5 s3/script/test: modify existing smbcquota test to use SMB2 in addition to SMB1. via 9070384 s3/smbd: smb2 server implementation for query get/set info. via b8802e2 s3/smbd: adjust smb1 server to use idl structs and generated ndr push/pull funcs via dd21b4f s3/libsmb: adjust smb2 code for new idl structs & generated ndr push/pull funcs. via 07e9113 s3/libsmb: adjust smb1 cli code to use idl structs and ndr push/pull funcs. via fd7c6f9 librpc/idl Add some query [getset]info quota related structures via 1033dd9 s3/smbd: Don't stat when doing a quota operation (as it's a fake file) via b934082 s3/libsmb: Avoid potential smbpanic calling parse_user_quota_list. via 2bfb9b4 s3/lib: Fix misleading typo in debug message from 8dac16e smb2_query_directory: make 'return true' explicit in smb2_query_directory_next_entry() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e053aad4ae46dfcda6143d55e8e913e923fa34be Author: Noel Power Date: Thu Jun 28 16:04:24 2018 +0100 s3/utils: fix regression where specifying -Unetbios/root works Usually you need to be root on a linux server to modify quotas. Even with a linux server joined to a windows AD you could always log in as local root with smbcquotas. However in recent builds this has changed. This patch fixes this BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jul 31 19:45:59 CEST 2018 on sn-devel-144 commit 705086d83c847c707e8230ce6a58e840a70d93c3 Author: Noel Power Date: Wed Mar 22 20:06:13 2017 + s3/smbd: allow set quota for non root user (when built with --enable-selftest) Currently it appears you need to be root to set quotas, for test purposes this requirement needs to be relaxed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 801c1856a39cbc2fd65183a7d6d8b7526dbc251e Author: Noel Power Date: Tue Mar 21 08:29:59 2017 + s3/script/tests: Add simple (smb1 & smb2) get/set/list tests for smbcquotas BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 90da2e599b1e46beea1d3dc4b6e9338786250882 Author: Noel Power Date: Wed Mar 8 14:27:27 2017 + s3/script/test: modify existing smbcquota test to use SMB2 in addition to SMB1. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 907038417673dc0076838586e620b88513d78cb0 Author: Noel Power Date: Fri May 26 16:02:33 2017 +0100 s3/smbd: smb2 server implementation for query get/set info. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit b8802e271337e5cec4f13ad4f505ae1905e09ca7 Author: Noel Power Date: Fri May 26 16:01:53 2017 +0100 s3/smbd: adjust smb1 server to use idl structs and generated ndr push/pull funcs BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit dd21b4fcfef4a663c43cf8e8601da350cbb0cfd3 Author: Noel Power Date: Fri May 26 15:50:18 2017 +0100 s3/libsmb: adjust smb2 code for new idl structs & generated ndr push/pull funcs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 07e9113291213831f489aac7cffe3ee99dfb3cea Author: Noel Power Date: Fri May 26 15:01:17 2017 +0100 s3/libsmb: adjust smb1 cli code to use idl structs and ndr push/pull funcs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit fd7c6f9bc7eb2de565ae9dc0aae6932904d53ec9 Author: Noel Power Date: Thu Mar 2 09:20:24 2017 + librpc/idl Add some query [getset]info quota related structures BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison commit 1033dd9e303fc91b97e2054713b714ed5f356eb8 Author: Noel Power Date: Tue Feb 28 11:36:47 2017 + s3/smbd: Don't stat when doing a quota operation (as it's a fake file) calling SMB_VFS_STAT on the quota fake file fails and ca
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 83bde8a FIXUP: Improve memory handling on py_net_change_password via e7144f2 python/samba/netcmd: net.change_password should be passed string via 75e1019 s4/libnet: Allow passwords containing non ascii characters to be passed via a8d8c6e testprogs/blackbox: Add test to set and use password with non-ascii via 7102732 python/samba: Fix incorrect encode of password via b28b6a4 s4/setup/tests: Add test for non ascii password setting samba-tool from 8109857 winbindd: Remove an unused function prototype https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 83bde8a49cf3015c71302fbd209f95006e7535b2 Author: Andrew Bartlett <abart...@samba.org> Date: Thu May 17 06:37:28 2018 +1200 FIXUP: Improve memory handling on py_net_change_password Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Noel Power <noel.po...@suse.com> Autobuild-User(master): Noel Power <npo...@samba.org> Autobuild-Date(master): Thu May 17 14:28:19 CEST 2018 on sn-devel-144 commit e7144f2e115f7d446de880a5680c2f2f02dd9467 Author: Noel Power <noel.po...@suse.com> Date: Wed May 16 16:51:34 2018 +0100 python/samba/netcmd: net.change_password should be passed string password param which in python2 (is str) is incorrectly encoded before passing to net.change_password. python2 - password is either unicode or str, if str we should decode to get unicode (and then pass to net.change_password). python3 - password is either str or bytes, if bytes then decode (and pass as 'str' to net.change_password). Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 75e1019f6162814eae3edb050d41784179cfa8ab Author: Noel Power <noel.po...@suse.com> Date: Wed May 16 16:46:41 2018 +0100 s4/libnet: Allow passwords containing non ascii characters to be passed Although we can pass unicode to py_net_change_password unfortunately in Python2 unicode strings are encoded with the default encoding (e.g. ascii) when extracting the unicode string to buffer. In Python3 the default encoding for "s" format is utf8. Use the "es" format instead of "s" so we can specify the encoding so behaviour is correct in py2/py3. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit a8d8c6ec439fb64ce33dc2406bb38792050ca3a1 Author: Noel Power <noel.po...@suse.com> Date: Tue May 15 18:27:23 2018 +0100 testprogs/blackbox: Add test to set and use password with non-ascii Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 7102732b25dfcd5e6815159e3043eed240e918d3 Author: Noel Power <noel.po...@suse.com> Date: Mon May 14 13:38:20 2018 +0100 python/samba: Fix incorrect encode of password In python2 you can encode a 'str' type which doesn't really make sense since it is already bytes (as such). In python3 this isn't possible you can't encode bytes or decode strings. Also because you can call encode on 'str' in python2 it tries to to what you wanted and it implicity calls decode('ascii') before performing the encode. This is why we get mention of ascii codec in the error. This patch should future proof for python3 also. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13435 Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit b28b6a4565870ac402b3678b4eecfe8e30fb0a73 Author: Noel Power <noel.po...@suse.com> Date: Mon May 14 13:48:18 2018 +0100 s4/setup/tests: Add test for non ascii password setting samba-tool Bug: https://bugzilla.samba.org/show_bug.cgi?id=13435 Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Andrew Bartlett <abart...@samba.org> --- Summary of changes: python/samba/netcmd/user.py | 6 -- python/samba/samdb.py| 6 +- source4/libnet/py_net.c | 26 ++ source4/setup/tests/blackbox_setpassword.sh | 2 ++ testprogs/blackbox/test_password_settings.sh | 17 + 5 files changed, 46 insertions(+), 11 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py index 4009d63..f211b51 100644 --- a/python/samba/netcmd/user.py +++ b/python/samba/netcmd/user.py @@ -54,7 +54,7 @@ from samba.netcmd import ( SuperCommand, Option, ) - +from samba.compat imp
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 268ad19 python/samba: Py2/Py3 compat change '/' to '//' to ensure int result via 141d908 python/samba: port some isinstance str checks (to cater for unicode) via b54472f python: Bulk conversion callers of ldb.Dn second param via 13280d3 python/samba: bulk conversion of caller to dsdb_Dn 2nd param. via cbd6786 python/samba: Add binary_type for p2/p3 testing. via d331ddf Add aliases for StringIO.StringIO via d2ee36e python/samba: Add some compatability PY2/PY3 functions via ba5f00d s4/param: Additionally accept unicode as string param in Py2 via 5c12935 s4/librpc: Additionally accept unicode as string param in Py2 via 5055b54 s4/dsdb: Additionally accept unicode as string param in Py2 via 3544f1b s4/auth: Additionally accept unicode as string param in Py2 via 7020af4 libcli/nbt: Additionally accept unicode as string param in Py2 via 702e85e lib/tevent: Additionally accept unicode as string param in Py2 via db8da07 lib/ldb: Additionally accept unicode as string param in Py2 via f477a75 samba-tool visualize: use correct DC in graph label from a23d805 ctdb-tests: Fix a typo https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 268ad19eee469ef7d703d5b9610683aca874fa9f Author: Noel Power <noel.po...@suse.com> Date: Fri Apr 27 08:15:28 2018 +0100 python/samba: Py2/Py3 compat change '/' to '//' to ensure int result Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Alexander Bokovoy <a...@samba.org> Autobuild-User(master): Noel Power <npo...@samba.org> Autobuild-Date(master): Mon Apr 30 18:25:25 CEST 2018 on sn-devel-144 commit 141d9081f4715b6c0ef439f34ca3b79fbddac1dd Author: Noel Power <noel.po...@suse.com> Date: Thu Apr 26 10:38:57 2018 +0100 python/samba: port some isinstance str checks (to cater for unicode) Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit b54472f868dc491579b471db6c6660bb03ab51c3 Author: Noel Power <noel.po...@suse.com> Date: Wed Apr 25 20:01:49 2018 +0100 python: Bulk conversion callers of ldb.Dn second param Convert second param passed to ldb.Dn to be unicode so py2 & py3 code will work Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit 13280d3db9fdbbd87c6ed2faa69b24bc7660674d Author: Noel Power <noel.po...@suse.com> Date: Wed Apr 25 18:28:30 2018 +0100 python/samba: bulk conversion of caller to dsdb_Dn 2nd param. Convert second param to dsdb_Dn to be unicode so py2 & py3 code will work Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit cbd6786c0471782024750b85b6f4fbf42977c81b Author: Noel Power <noel.po...@suse.com> Date: Tue Apr 24 16:28:41 2018 +0100 python/samba: Add binary_type for p2/p3 testing. For helping test for binary types, binary_type evaluates to 'str' in py2, and 'bytes' in py3. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit d331ddf47f7b0ee360a8c7a61e0b38d279ecbd48 Author: Noel Power <noel.po...@suse.com> Date: Tue Apr 17 13:52:58 2018 +0100 Add aliases for StringIO.StringIO cStringIO doesn't handle unicode, StringIO does. With py2/py3 compatable code we can easily find ourselves getting passed unicode so we don't alias cStringIO Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit d2ee36e350108a226a3d3dc641a067c9eed4897d Author: Noel Power <noel.po...@suse.com> Date: Fri Apr 13 11:19:10 2018 +0100 python/samba: Add some compatability PY2/PY3 functions I hope these changes are a short term interim solution for the absence of the 'six' module/library. I also hope that soon this module can be removed and be replaced by usage of six. Signed-off-by: Noel Power <noel.po...@suse.com> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit ba5f00deb772b76719bfd06467a6b05edfeef061 Author: Noel Power <noel.po...@suse.com> Date: Fri Apr 13 17:34:40 2018 +0100 s4/param: Additionally accept unicode as string param in Py2 With the changes to make samba python code Py2/Py3 compatible there now are many instances where string content is decoded. Decoded string variables in Py2 are returned as the unicode type. Many Py2 c-module functions that take string arguments only check for the string type. However now it's quite possibe the content formally passed as a st