The Samba-Bugzilla – Attachment 15134 Details for
Bug 13937
Fix several issues detected by GCC 9
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.10
v4-10-gcc9-fixes.patch (text/plain), 13.13 KB, created by
Andreas Schneider
on 2019-05-09 06:39:38 UTC
(
hide
)
Description:
patch for 4.10
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2019-05-09 06:39:38 UTC
Size:
13.13 KB
patch
obsolete
>From 73e36c202edf73c74e6bf244f7a4c6a8efee543f Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 16:27:57 +0200 >Subject: [PATCH 01/10] s4:auth: Fix debug statement in gensec_gssapi > >The 'role' is set to null, we should first set it to the correct value >before printing anything. > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit bd29f3fcc023d00afde8e9cc2f9db22dcae49877) >--- > source4/auth/gensec/gensec_gssapi.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c >index a61b2b2659c..4577c91c93a 100644 >--- a/source4/auth/gensec/gensec_gssapi.c >+++ b/source4/auth/gensec/gensec_gssapi.c >@@ -703,11 +703,7 @@ init_sec_context_done: > OM_uint32 lifetime = 0; > gss_cred_usage_t usage; > const char *role = NULL; >- DEBUG(0, ("GSS %s Update(krb5)(%d) Update failed, credentials expired during GSSAPI handshake!\n", >- role, >- gensec_gssapi_state->gss_exchange_count)); > >- > switch (gensec_security->gensec_role) { > case GENSEC_CLIENT: > creds = gensec_gssapi_state->client_cred->creds; >@@ -719,6 +715,11 @@ init_sec_context_done: > break; > } > >+ DBG_ERR("GSS %s Update(krb5)(%d) failed, credentials " >+ "expired during GSSAPI handshake!\n", >+ role, >+ gensec_gssapi_state->gss_exchange_count); >+ > maj_stat = gss_inquire_cred(&min_stat, > creds, > &name, &lifetime, &usage, NULL); >-- >2.21.0 > > >From 452bdab42480c8137207ba7430cbe2a9faf992f1 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 16:31:10 +0200 >Subject: [PATCH 02/10] s3:rpc_server: Do not free the tdbname before we > printed it > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 790d7e34cbe4e190d6acdd24696efe53944cd4a6) >--- > source3/rpc_server/eventlog/srv_eventlog_nt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/source3/rpc_server/eventlog/srv_eventlog_nt.c b/source3/rpc_server/eventlog/srv_eventlog_nt.c >index ce27dd530e1..5093125a6f6 100644 >--- a/source3/rpc_server/eventlog/srv_eventlog_nt.c >+++ b/source3/rpc_server/eventlog/srv_eventlog_nt.c >@@ -95,13 +95,13 @@ static bool elog_check_access( EVENTLOG_INFO *info, const struct security_token > tdbname, > SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, > &sec_desc); >- TALLOC_FREE( tdbname ); >- > if (!NT_STATUS_IS_OK(status)) { > DEBUG(5,("elog_check_access: Unable to get NT ACL for %s: %s\n", > tdbname, nt_errstr(status))); >+ TALLOC_FREE(tdbname); > return False; > } >+ TALLOC_FREE(tdbname); > > ace = talloc_zero(sec_desc, struct security_ace); > if (ace == NULL) { >-- >2.21.0 > > >From e442b183bb9a13e11be381f439837e3f586ac2c9 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 16:32:45 +0200 >Subject: [PATCH 03/10] s4:ntvfs: Do not free eadb before we printed an error > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 6da032df5450ef72f8608a19b3b5cc6e9185cd6e) >--- > source4/ntvfs/posix/vfs_posix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c >index df5637486d3..c69e979c31c 100644 >--- a/source4/ntvfs/posix/vfs_posix.c >+++ b/source4/ntvfs/posix/vfs_posix.c >@@ -123,7 +123,6 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) > pvfs, eadb, 50000, > lpcfg_tdb_flags(pvfs->ntvfs->ctx->lp_ctx, TDB_DEFAULT), > O_RDWR|O_CREAT, 0600); >- TALLOC_FREE(eadb); > if (pvfs->ea_db != NULL) { > pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; > } else { >@@ -131,6 +130,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) > eadb, strerror(errno))); > pvfs->flags &= ~PVFS_FLAG_XATTR_ENABLE; > } >+ TALLOC_FREE(eadb); > } > > if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) { >-- >2.21.0 > > >From b31c0cc65cf093beba9aedbb585c0c35c59ef073 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 16:51:20 +0200 >Subject: [PATCH 04/10] s4:torture: Do not print NULL strings we just checked > before > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit be72dfbc8edc53ed191dc01668a53cafb5cd785d) >--- > source4/torture/rpc/drsuapi_cracknames.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/source4/torture/rpc/drsuapi_cracknames.c b/source4/torture/rpc/drsuapi_cracknames.c >index c03f6bd1ca9..33917832069 100644 >--- a/source4/torture/rpc/drsuapi_cracknames.c >+++ b/source4/torture/rpc/drsuapi_cracknames.c >@@ -213,13 +213,13 @@ static bool test_DsCrackNamesMatrix(struct torture_context *tctx, > } else if (n_matrix[i][j] == NULL && formats[j] == DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL) { > } else if (n_matrix[i][j] == NULL && n_from[j] != NULL) { > err_msg = talloc_asprintf(mem_ctx, >- "dcerpc_drsuapi_DsCrackNames mismatch - from %d to %d: %s should be %s", >- formats[i], formats[j], n_matrix[i][j], n_from[j]); >+ "dcerpc_drsuapi_DsCrackNames mismatch - from %d to %d: should be %s", >+ formats[i], formats[j], n_from[j]); > torture_fail(tctx, err_msg); > } else if (n_matrix[i][j] != NULL && n_from[j] == NULL) { > err_msg = talloc_asprintf(mem_ctx, >- "dcerpc_drsuapi_DsCrackNames mismatch - from %d to %d: %s should be %s", >- formats[i], formats[j], n_matrix[i][j], n_from[j]); >+ "dcerpc_drsuapi_DsCrackNames mismatch - from %d to %d: should be %s", >+ formats[i], formats[j], n_matrix[i][j]); > torture_fail(tctx, err_msg); > } else if (strcmp(n_matrix[i][j], n_from[j]) != 0) { > err_msg = talloc_asprintf(mem_ctx, >-- >2.21.0 > > >From 42c44f47030db66d2f1a1a9c304ea0137bd32290 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 16:54:30 +0200 >Subject: [PATCH 05/10] lib:torture: Fix string comparison macros where we > directly pass NULL > >See e.g. lib/util/tests/strlist.c +177 > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit a8f773e326d6bdfc1c9eb87a74c00108f6620c56) >--- > lib/torture/torture.h | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/lib/torture/torture.h b/lib/torture/torture.h >index c0fbdb9081d..9af7e42d851 100644 >--- a/lib/torture/torture.h >+++ b/lib/torture/torture.h >@@ -323,7 +323,9 @@ void torture_result(struct torture_context *test, > #define torture_assert_casestr_equal(torture_ctx,got,expected,cmt) \ > do { const char *__got = (got), *__expected = (expected); \ > if (!strequal(__got, __expected)) { \ >- torture_result(torture_ctx, TORTURE_FAIL, __location__": "#got" was %s, expected %s: %s", __got, __expected, cmt); \ >+ torture_result(torture_ctx, TORTURE_FAIL, \ >+ __location__": "#got" was %s, expected %s: %s", \ >+ __got, __expected == NULL ? "null" : __expected, cmt); \ > return false; \ > } \ > } while(0) >@@ -332,8 +334,8 @@ void torture_result(struct torture_context *test, > do { const char *__got = (got), *__expected = (expected); \ > if (strcmp_safe(__got, __expected) != 0) { \ > torture_result(torture_ctx, TORTURE_FAIL, \ >- __location__": "#got" was %s, expected %s: %s", \ >- __got, __expected, cmt); \ >+ __location__": "#got" was %s, expected %s: %s", \ >+ __got, __expected == NULL ? "NULL" : __expected, cmt); \ > return false; \ > } \ > } while(0) >-- >2.21.0 > > >From 84f16b24c8c632a42d37a93a4e5e5c8d7bd016e9 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 16:58:07 +0200 >Subject: [PATCH 06/10] s4:torture: Do not free full_name before we printed it > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 46f036d3231bc99cf37c7cabf82757d3c28c5cff) >--- > source4/torture/vfs/fruit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c >index e460ce20336..e0ba935ff99 100644 >--- a/source4/torture/vfs/fruit.c >+++ b/source4/torture/vfs/fruit.c >@@ -1163,11 +1163,11 @@ static bool check_stream(struct smb2_tree *tree, > > status = smb2_create(tree, mem_ctx, &create); > if (!NT_STATUS_IS_OK(status)) { >- TALLOC_FREE(full_name); > if (value == NULL) { > return true; > } > torture_comment(tctx, "Unable to open stream %s\n", full_name); >+ TALLOC_FREE(full_name); > return false; > } > >-- >2.21.0 > > >From 7ca36977b110a5e15662de64cfbb89dd39116aad Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 17:03:54 +0200 >Subject: [PATCH 07/10] ctdb:common: Do not print NULL if we don't get a > sockpath > >sock_socket_start_recv() might not fill sockpath if we return early. > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 830cb7e67568de5f3ce359cb6af3be8ab545c824) >--- > ctdb/common/sock_daemon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/ctdb/common/sock_daemon.c b/ctdb/common/sock_daemon.c >index e5e16f8af12..6298653f4ec 100644 >--- a/ctdb/common/sock_daemon.c >+++ b/ctdb/common/sock_daemon.c >@@ -893,7 +893,7 @@ static void sock_daemon_run_socket_fail(struct tevent_req *subreq) > subreq, struct tevent_req); > struct sock_daemon_run_state *state = tevent_req_data( > req, struct sock_daemon_run_state); >- const char *sockpath = NULL; >+ const char *sockpath = "INVALID"; > int ret = 0; > bool status; > >-- >2.21.0 > > >From 570918993869aebf715f1bc8dd04cdda057bdc16 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 17:05:58 +0200 >Subject: [PATCH 08/10] s3:winbindd: Do not free db_path in idmap_tdb2 before > we printed it > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit e333425e0ff6be5691b74a920610b508e7d26892) >--- > source3/winbindd/idmap_tdb2.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c >index 3ae309e5e5b..b784546bb33 100644 >--- a/source3/winbindd/idmap_tdb2.c >+++ b/source3/winbindd/idmap_tdb2.c >@@ -115,13 +115,13 @@ static NTSTATUS idmap_tdb2_open_db(struct idmap_domain *dom) > /* Open idmap repository */ > ctx->db = db_open(ctx, db_path, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644, > DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE); >- TALLOC_FREE(db_path); >- > if (ctx->db == NULL) { > DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n", > db_path)); >+ TALLOC_FREE(db_path); > return NT_STATUS_UNSUCCESSFUL; > } >+ TALLOC_FREE(db_path); > > return idmap_tdb2_init_hwm(dom); > } >-- >2.21.0 > > >From 94f1fa281f5cc2db470b0059a18884f5f3a9accb Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 17:11:13 +0200 >Subject: [PATCH 09/10] s3:utils: If share is NULL in smbcquotas, don't print > it > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 3653dc7013518d90e6deb08a1f21d7472dc86675) >--- > source3/utils/smbcquotas.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c >index a4b1b8111a5..ca8b192e75c 100644 >--- a/source3/utils/smbcquotas.c >+++ b/source3/utils/smbcquotas.c >@@ -712,8 +712,8 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" }, > exit(EXIT_PARSE_ERROR); > } > share = strchr_m(server,'\\'); >- if (!share) { >- printf("Invalid argument: %s\n", share); >+ if (share == NULL) { >+ printf("Invalid argument\n"); > exit(EXIT_PARSE_ERROR); > } > >-- >2.21.0 > > >From 2653d3f2626dcea218f3671e700dcf2b9b1e3ce1 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 8 May 2019 17:12:12 +0200 >Subject: [PATCH 10/10] s3:utils: If share is NULL in smbcacls, don't print it > >Found by GCC 9. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13937 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 2b957bde5a2f0f670ee0c8acde6edae1f4aaf253) >--- > source3/utils/smbcacls.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c >index 7a39de9e5e7..ed3574d6f2a 100644 >--- a/source3/utils/smbcacls.c >+++ b/source3/utils/smbcacls.c >@@ -909,8 +909,8 @@ int main(int argc, char *argv[]) > return -1; > } > share = strchr_m(server,'\\'); >- if (!share) { >- printf("Invalid argument: %s\n", share); >+ if (share == NULL) { >+ printf("Invalid argument\n"); > return -1; > } > >-- >2.21.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 13937
:
15133
| 15134