[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Thu Oct 20 00:49:03 UTC 2016
The branch, master has been updated
via beda6d3 torture: Fix uninitialized variables
from c21a6ed s3: libsmb: Fix cut and paste error using the wrong structure type.
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit beda6d3d48c30945bf4eac7d1d9e73967856bb51
Author: Volker Lendecke <vl at samba.org>
Date: Wed Oct 19 10:27:14 2016 +0200
torture: Fix uninitialized variables
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Oct 20 02:48:30 CEST 2016 on sn-devel-144
-----------------------------------------------------------------------
Summary of changes:
source4/torture/smb2/acls.c | 15 +++++++-----
source4/torture/smb2/create.c | 3 ++-
source4/torture/smb2/dir.c | 5 ++--
source4/torture/smb2/durable_open.c | 16 ++++++++-----
source4/torture/smb2/lease.c | 45 +++++++++++++++++++++++++-----------
source4/torture/smb2/lock.c | 46 +++++++++++++++++++++++++------------
source4/torture/smb2/notify.c | 5 ++--
source4/torture/smb2/streams.c | 12 ++++++----
source4/torture/vfs/acl_xattr.c | 6 +++--
9 files changed, 102 insertions(+), 51 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/torture/smb2/acls.c b/source4/torture/smb2/acls.c
index d4c575b..beb5abf 100644
--- a/source4/torture/smb2/acls.c
+++ b/source4/torture/smb2/acls.c
@@ -99,7 +99,7 @@ static bool test_creator_sid(struct torture_context *tctx, struct smb2_tree *tre
struct smb2_create io;
const char *fname = BASEDIR "\\creator.txt";
bool ret = true;
- struct smb2_handle handle;
+ struct smb2_handle handle = {{0}};
union smb_fileinfo q;
union smb_setfileinfo set;
struct security_descriptor *sd, *sd_orig, *sd2;
@@ -301,7 +301,7 @@ static bool test_generic_bits(struct torture_context *tctx, struct smb2_tree *tr
struct smb2_create io;
const char *fname = BASEDIR "\\generic.txt";
bool ret = true;
- struct smb2_handle handle;
+ struct smb2_handle handle = {{0}};
int i;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -667,7 +667,7 @@ static bool test_owner_bits(struct torture_context *tctx, struct smb2_tree *tree
struct smb2_create io;
const char *fname = BASEDIR "\\test_owner_bits.txt";
bool ret = true;
- struct smb2_handle handle;
+ struct smb2_handle handle = {{0}};
int i;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -803,7 +803,8 @@ static bool test_inheritance(struct torture_context *tctx, struct smb2_tree *tre
const char *fname1 = BASEDIR "\\inheritance\\testfile";
const char *fname2 = BASEDIR "\\inheritance\\testdir";
bool ret = true;
- struct smb2_handle handle, handle2;
+ struct smb2_handle handle = {{0}};
+ struct smb2_handle handle2 = {{0}};
int i;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -1278,7 +1279,8 @@ static bool test_inheritance_flags(struct torture_context *tctx,
const char *dname = BASEDIR "\\inheritance";
const char *fname1 = BASEDIR "\\inheritance\\testfile";
bool ret = true;
- struct smb2_handle handle, handle2;
+ struct smb2_handle handle = {{0}};
+ struct smb2_handle handle2 = {{0}};
int i, j;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -1510,7 +1512,8 @@ static bool test_inheritance_dynamic(struct torture_context *tctx,
const char *dname = BASEDIR "\\inheritance";
const char *fname1 = BASEDIR "\\inheritance\\testfile";
bool ret = true;
- struct smb2_handle handle, handle2;
+ struct smb2_handle handle = {{0}};
+ struct smb2_handle handle2 = {{0}};
union smb_fileinfo q;
union smb_setfileinfo set;
struct security_descriptor *sd, *sd_orig=NULL;
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c
index 9b38400..09a17be 100644
--- a/source4/torture/smb2/create.c
+++ b/source4/torture/smb2/create.c
@@ -706,7 +706,8 @@ static bool test_smb2_open(struct torture_context *tctx,
const char *fname = DNAME "\\torture_ntcreatex.txt";
const char *dname = DNAME "\\torture_ntcreatex.dir";
NTSTATUS status;
- struct smb2_handle h, h1;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h1 = {{0}};
bool ret = true;
int i;
struct {
diff --git a/source4/torture/smb2/dir.c b/source4/torture/smb2/dir.c
index 715e984..2e5db91 100644
--- a/source4/torture/smb2/dir.c
+++ b/source4/torture/smb2/dir.c
@@ -203,7 +203,8 @@ static bool test_fixed(struct torture_context *tctx,
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create create;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
struct smb2_find f;
union smb_search_data *d;
struct file_elem files[NFILES] = {};
@@ -1265,7 +1266,7 @@ static bool test_large_files(struct torture_context *tctx,
NTSTATUS status;
struct smb2_create create;
struct smb2_find f;
- struct smb2_handle h;
+ struct smb2_handle h = {{0}};
union smb_search_data *d;
int i, j, file_count = 0;
char **strs = NULL;
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c
index 7b59566..2e68170 100644
--- a/source4/torture/smb2/durable_open.c
+++ b/source4/torture/smb2/durable_open.c
@@ -1918,7 +1918,8 @@ static bool test_durable_open_oplock(struct torture_context *tctx,
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io1, io2;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
char fname[256];
bool ret = true;
@@ -1993,7 +1994,8 @@ static bool test_durable_open_lease(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io1, io2;
struct smb2_lease ls1, ls2;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
char fname[256];
bool ret = true;
@@ -2092,7 +2094,7 @@ static bool test_durable_open_lock_oplock(struct torture_context *tctx,
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
- struct smb2_handle h;
+ struct smb2_handle h = {{0}};
struct smb2_lock lck;
struct smb2_lock_element el[2];
NTSTATUS status;
@@ -2174,7 +2176,7 @@ static bool test_durable_open_lock_lease(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h;
+ struct smb2_handle h = {{0}};
struct smb2_lock lck;
struct smb2_lock_element el[2];
NTSTATUS status;
@@ -2279,7 +2281,8 @@ static bool test_durable_open_open2_lease(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io1, io2;
struct smb2_lease ls;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
char fname[256];
bool ret = true;
@@ -2385,7 +2388,8 @@ static bool test_durable_open_open2_oplock(struct torture_context *tctx,
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io1, io2;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
char fname[256];
bool ret = true;
diff --git a/source4/torture/smb2/lease.c b/source4/torture/smb2/lease.c
index 6a2e88b..3ee915c 100644
--- a/source4/torture/smb2/lease.c
+++ b/source4/torture/smb2/lease.c
@@ -121,7 +121,8 @@ static bool test_lease_request(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
const char *fname = "lease_request.dat";
const char *fname2 = "lease_request.2.dat";
@@ -209,7 +210,8 @@ static bool test_lease_upgrade(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h, hnew;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle hnew = {{0}};
NTSTATUS status;
const char *fname = "lease_upgrade.dat";
bool ret = true;
@@ -840,7 +842,8 @@ static bool test_lease_nobreakself(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
const char *fname = "lease_nobreakself.dat";
bool ret = true;
@@ -919,7 +922,8 @@ static bool test_lease_statopen(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
const char *fname = "lease_statopen.dat";
bool ret = true;
@@ -1192,7 +1196,9 @@ static bool test_lease_multibreak(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h, h2, h3;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_multibreak.dat";
@@ -1311,7 +1317,7 @@ static bool test_lease_v2_request_parent(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1;
+ struct smb2_handle h1 = {{0}};
uint64_t parent = LEASE2;
NTSTATUS status;
const char *fname = "lease_v2_request_parent.dat";
@@ -1367,7 +1373,7 @@ static bool test_lease_break_twice(struct torture_context *tctx,
struct smb2_create io;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h1;
+ struct smb2_handle h1 = {{0}};
NTSTATUS status;
const char *fname = "lease_break_twice.dat";
bool ret = true;
@@ -1439,7 +1445,11 @@ static bool test_lease_v2_request(struct torture_context *tctx,
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls1, ls2, ls2t, ls3, ls4;
- struct smb2_handle h1, h2, h3, h4, h5;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
+ struct smb2_handle h4 = {{0}};
+ struct smb2_handle h5 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_v2_request.dat";
@@ -3060,7 +3070,9 @@ static bool test_lease_complex1(struct torture_context *tctx,
struct smb2_create io2;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h2, h3;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_complex1.dat";
@@ -3186,7 +3198,9 @@ static bool test_lease_v2_complex1(struct torture_context *tctx,
struct smb2_create io2;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h2, h3;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_v2_complex1.dat";
@@ -3331,7 +3345,8 @@ static bool test_lease_v2_complex2(struct torture_context *tctx,
struct smb2_create io2;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
struct smb2_request *req2 = NULL;
struct smb2_lease_break_ack ack = {};
NTSTATUS status;
@@ -3440,7 +3455,9 @@ static bool test_lease_timeout(struct torture_context *tctx,
struct smb2_create io;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, hnew, h1b;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle hnew = {{0}};
+ struct smb2_handle h1b = {{0}};
NTSTATUS status;
const char *fname = "lease_timeout.dat";
bool ret = true;
@@ -3568,7 +3585,9 @@ static bool test_lease_v2_rename(struct torture_context *tctx,
struct smb2_create io;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h1, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
union smb_setfileinfo sinfo;
const char *fname = "lease_v2_rename_src.dat";
const char *fname_dst = "lease_v2_rename_dst.dat";
diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c
index 3900abf..ff42211 100644
--- a/source4/torture/smb2/lock.c
+++ b/source4/torture/smb2/lock.c
@@ -587,7 +587,8 @@ static bool test_lock(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[2];
@@ -799,7 +800,8 @@ static bool test_async(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[2];
@@ -867,7 +869,8 @@ static bool test_cancel(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[2];
@@ -995,7 +998,8 @@ static bool test_cancel_tdis(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[2];
@@ -1089,7 +1093,8 @@ static bool test_cancel_logoff(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[2];
@@ -1185,7 +1190,8 @@ static bool test_errorcode(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[2];
@@ -1348,7 +1354,8 @@ static bool test_zerobytelength(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
int i;
@@ -1467,7 +1474,8 @@ static bool test_zerobyteread(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[1];
@@ -1585,7 +1593,8 @@ static bool test_unlock(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el1[1];
@@ -2136,7 +2145,8 @@ static bool test_stacking(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[1];
@@ -2339,7 +2349,8 @@ static bool test_contend(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[1];
@@ -2408,7 +2419,8 @@ static bool test_context(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[1];
@@ -2474,7 +2486,8 @@ static bool test_range(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[1];
@@ -2675,7 +2688,9 @@ static bool test_overlap(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2, h3;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
uint8_t buf[200];
bool correct = true;
@@ -2775,7 +2790,8 @@ static bool test_truncate(struct torture_context *torture,
{
NTSTATUS status;
bool ret = true;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
uint8_t buf[200];
struct smb2_lock lck;
struct smb2_lock_element el[1];
diff --git a/source4/torture/smb2/notify.c b/source4/torture/smb2/notify.c
index d9b0f59..90f5ad9 100644
--- a/source4/torture/smb2/notify.c
+++ b/source4/torture/smb2/notify.c
@@ -234,7 +234,8 @@ static bool torture_smb2_notify_dir(struct torture_context *torture,
union smb_open io;
union smb_close cl;
int i, count;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
struct smb2_request *req, *req2;
const char *fname = BASEDIR "\\subdir-name";
extern int torture_numops;
@@ -2110,7 +2111,7 @@ static bool torture_smb2_notify_tcon(struct torture_context *torture,
NTSTATUS status;
union smb_notify notify;
union smb_open io;
- struct smb2_handle h1;
+ struct smb2_handle h1 = {{0}};
struct smb2_request *req = NULL;
struct smb2_tree *tree1 = NULL;
const char *fname = BASEDIR "\\subdir-name";
diff --git a/source4/torture/smb2/streams.c b/source4/torture/smb2/streams.c
index 8c3f161..e48a217 100644
--- a/source4/torture/smb2/streams.c
+++ b/source4/torture/smb2/streams.c
@@ -675,7 +675,8 @@ static bool test_stream_delete(struct torture_context *tctx,
const char *fname = DNAME "\\stream_delete.txt";
const char *sname1;
bool ret = true;
- struct smb2_handle h, h1;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h1 = {{0}};
struct smb2_read r;
if (torture_setting_bool(tctx, "samba4", false)) {
@@ -1146,7 +1147,8 @@ static bool test_stream_names2(struct torture_context *tctx,
union smb_open io;
const char *fname = DNAME "\\stream_names2.txt";
bool ret = true;
- struct smb2_handle h, h1;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h1 = {{0}};
uint8_t i;
--
Samba Shared Repository
More information about the samba-cvs
mailing list