[PATCHSET] Add support for fall through attribute
Andreas Schneider
asn at samba.org
Tue Dec 12 07:36:30 UTC 2017
On Thursday, 7 December 2017 11:30:14 CET Andrew Bartlett via samba-technical
wrote:
> On Thu, 2017-12-07 at 11:00 +0100, Andreas Schneider via samba-
>
> technical wrote:
> > Hello,
> >
> > at least GCC offers a new warning: -Wimplicit-fallthrough
> >
> > It also has an attribute to mark a case in a switch statement as fall
> > through to disable the warning!
> >
> >
> > Please review and push if OK.
>
> This looks great. I'll look over it more carefully tomorrow, but a big
> thanks for investigating ways to make our C a little more safe!
Ping :-)
Rebased patchset attached!
Thanks,
Andreas
--
Andreas Schneider GPG-ID: CC014E3D
Samba Team asn at samba.org
www.samba.org
-------------- next part --------------
>From 751d8b1749b81d038d6f0ffef9e928b3bb952751 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:16:43 +0200
Subject: [PATCH 01/59] s4:lib:com: Fix function declartions
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/lib/com/classes/simple.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/source4/lib/com/classes/simple.c b/source4/lib/com/classes/simple.c
index 7d0573372e3..4d28a158102 100644
--- a/source4/lib/com/classes/simple.c
+++ b/source4/lib/com/classes/simple.c
@@ -43,13 +43,22 @@ static uint32_t simple_IUnknown_Release (struct IUnknown *d, TALLOC_CTX *mem_ctx
return 1;
}
-static WERROR simple_IStream_Read (struct IStream *d, TALLOC_CTX *mem_ctx, uint8_t *pv, uint32_t num_requested, uint32_t *num_readx, uint32_t num_read)
+static WERROR simple_IStream_Read(struct IStream *d,
+ TALLOC_CTX *mem_ctx,
+ uint8_t *pv,
+ uint32_t num_requested,
+ uint32_t *num_readx,
+ uint32_t *num_read)
{
- printf("%d bytes are being read\n", num_read);
+ printf("%d bytes are being read\n", *num_read);
return WERR_OK;
}
-static WERROR simple_IStream_Write (struct IStream *d, TALLOC_CTX *mem_ctx, uint8_t *data, uint32_t num_requested, uint32_t num_written)
+static WERROR simple_IStream_Write(struct IStream *d,
+ TALLOC_CTX *mem_ctx,
+ uint8_t *data,
+ uint32_t num_requested,
+ uint32_t *num_written)
{
printf("%d bytes are being written\n", num_requested);
return WERR_OK;
@@ -62,7 +71,11 @@ static WERROR simpleclass_IUnknown_QueryInterface (struct IUnknown *d, TALLOC_CT
return WERR_OK;
}
-static WERROR simpleclass_IClassFactory_CreateInstance (struct IClassFactory *d, TALLOC_CTX *mem_ctx, struct IUnknown *iunk, struct GUID *iid, struct IUnknown **ppv)
+static WERROR simpleclass_IClassFactory_CreateInstance(struct IClassFactory *d,
+ TALLOC_CTX *mem_ctx,
+ struct MInterfacePointer *pUnknown,
+ struct GUID *iid,
+ struct MInterfacePointer *ppv)
{
struct IStream *ret;
/* FIXME: Check whether IID == ISTREAM_IID */
@@ -71,8 +84,8 @@ static WERROR simpleclass_IClassFactory_CreateInstance (struct IClassFactory *d,
ret->vtable = &simple_IStream_vtable;
ret->object_data = NULL;
- *ppv = (struct IUnknown *)ret;
-
+ ppv = (struct MInterfacePointer *)ret;
+
return WERR_OK;
}
--
2.15.1
>From d798191cc91e8accd058e89fbe9e77712e4da388 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 16:51:39 +0200
Subject: [PATCH 02/59] lib:texpect: Avoid some compiler warnings
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/texpect/texpect.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c
index b553de8ca5c..dd786705e8e 100644
--- a/lib/texpect/texpect.c
+++ b/lib/texpect/texpect.c
@@ -434,6 +434,9 @@ int main(int argc, const char **argv)
switch (pid) {
case -1:
err(1, "Failed to fork");
+
+ /* Never reached */
+ return 1;
case 0:
if(setsid()<0)
@@ -448,6 +451,9 @@ int main(int argc, const char **argv)
/* texpect <expect_instructions> <progname> [<args>] */
execvp(program, program_args);
err(1, "Failed to exec: %s", program);
+
+ /* Never reached */
+ return 1;
default:
close(slave);
{
@@ -462,4 +468,7 @@ int main(int argc, const char **argv)
return eval_parent(pid);
}
+
+ /* Never reached */
+ return 1;
}
--
2.15.1
>From e24b9298e5c8164456b4ec110438c89438d4521d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 16:33:10 +0200
Subject: [PATCH 03/59] lib:replace: Add FALL_THROUGH support
Signed-off-by: Andreas Schneider <asn at samba.org>
---
.ycm_extra_conf.py | 1 +
lib/replace/replace.h | 9 +++++++++
lib/replace/wscript | 31 +++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+)
diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py
index c96b59e373b..97122a9169e 100644
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -47,6 +47,7 @@ flags = [
'-D_XOPEN_SOURCE_EXTENDED=1',
'-DAD_DC_BUILD_IS_ENABLED=1',
'-DHAVE_IPV6=1',
+ '-DFALL_THROUGH',
'-I/usr/local/include',
'-I.',
'-Iauth',
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index 128978c561e..e142dd1dbea 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -922,6 +922,15 @@ void rep_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
#define setproctitle_init rep_setproctitle_init
void rep_setproctitle_init(int argc, char *argv[], char *envp[]);
#endif
+
+#ifndef FALL_THROUGH
+# ifdef HAVE_FALLTHROUGH_ATTRIBUTE
+# define FALL_THROUGH __attribute__ ((fallthrough))
+# else /* HAVE_FALLTHROUGH_ATTRIBUTE */
+# define FALL_THROUGH
+# endif /* HAVE_FALLTHROUGH_ATTRIBUTE */
+#endif /* FALL_THROUGH */
+
bool nss_wrapper_enabled(void);
bool nss_wrapper_hosts_enabled(void);
bool socket_wrapper_enabled(void);
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 2f94d4937d3..a6e3eba28f4 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -222,6 +222,37 @@ def configure(conf):
headers='stdint.h sys/atomic.h',
msg='Checking for atomic_add_32 compiler builtin')
+ conf.CHECK_CODE('''
+ #define FALL_THROUGH __attribute__((fallthrough))
+
+ enum direction_e {
+ UP = 0,
+ DOWN,
+ };
+
+ int main(void) {
+ enum direction_e key = UP;
+ int i = 10;
+ int j = 0;
+
+ switch (key) {
+ case UP:
+ i = 5;
+ FALL_THROUGH;
+ case DOWN:
+ j = i * 2;
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+ }
+ ''',
+ 'HAVE_FALLTHROUGH_ATTRIBUTE',
+ addmain=False,
+ msg='Checking for fallthrough attribute')
+
# these may be builtins, so we need the link=False strategy
conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy strncpy bzero', link=False)
--
2.15.1
>From 5338cdd44ab13af7b43685a634538cdfff346de8 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:25:46 +0200
Subject: [PATCH 04/59] lib:replace: Add FALL_THROUGH statements in strptime.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/replace/strptime.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/replace/strptime.c b/lib/replace/strptime.c
index 20e5d8c39b6..bbc742277de 100644
--- a/lib/replace/strptime.c
+++ b/lib/replace/strptime.c
@@ -462,7 +462,8 @@ strptime_internal (rp, fmt, tm, decided, era_cnt)
*decided = raw;
}
#endif
- /* Fall through. */
+
+ FALL_THROUGH;
case 'D':
/* Match standard day format. */
if (!recursive (HERE_D_FMT))
@@ -611,7 +612,8 @@ strptime_internal (rp, fmt, tm, decided, era_cnt)
*decided = raw;
}
#endif
- /* Fall through. */
+
+ FALL_THROUGH;
case 'T':
if (!recursive (HERE_T_FMT))
return NULL;
--
2.15.1
>From c16e29b378377310902dc9a277a9963a4f7adc20 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 15:17:21 +0200
Subject: [PATCH 05/59] lib:ldb: Add FALL_THROUGH statements in common/ldb_dn.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/ldb/common/ldb_dn.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index b23ee1734cd..dfeb600f56f 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -629,7 +629,8 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
l++;
break;
}
- /* fall through */
+
+ FALL_THROUGH;
case '\"':
case '<':
case '>':
--
2.15.1
>From 6d4e4c50d8b537281e4f1a59bc67dd826d92c436 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 15:18:28 +0200
Subject: [PATCH 06/59] lib:ldb: Add FALL_THROUGH statements in
ldb_map/ldb_map_inbound.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/ldb/ldb_map/ldb_map_inbound.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/ldb/ldb_map/ldb_map_inbound.c b/lib/ldb/ldb_map/ldb_map_inbound.c
index 461e68113ab..861c4c1622d 100644
--- a/lib/ldb/ldb_map/ldb_map_inbound.c
+++ b/lib/ldb/ldb_map/ldb_map_inbound.c
@@ -87,7 +87,8 @@ static int ldb_msg_el_partition(struct ldb_module *module, enum ldb_request_type
el = ldb_msg_el_map_local(module, remote, map, old);
break;
}
- /* fall through */
+
+ FALL_THROUGH;
case LDB_MAP_IGNORE:
goto local;
@@ -99,7 +100,8 @@ static int ldb_msg_el_partition(struct ldb_module *module, enum ldb_request_type
map->local_name);
goto local;
}
- /* fall through */
+
+ FALL_THROUGH;
case LDB_MAP_KEEP:
case LDB_MAP_RENAME:
el = ldb_msg_el_map_local(module, remote, map, old);
--
2.15.1
>From a9444a2b63624c444649925dc7c2d86f34064c0e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 15:19:23 +0200
Subject: [PATCH 07/59] lib:ldb: Add FALL_THROUGH statements in
ldb_map/ldb_map.c
---
lib/ldb/ldb_map/ldb_map.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/ldb/ldb_map/ldb_map.c b/lib/ldb/ldb_map/ldb_map.c
index f2a86fedd45..b453dff80d2 100644
--- a/lib/ldb/ldb_map/ldb_map.c
+++ b/lib/ldb/ldb_map/ldb_map.c
@@ -523,7 +523,8 @@ struct ldb_dn *ldb_dn_map_local(struct ldb_module *module, void *mem_ctx, struct
"used in DN!", ldb_dn_get_component_name(dn, i));
goto failed;
}
- /* fall through */
+
+ FALL_THROUGH;
case LDB_MAP_KEEP:
case LDB_MAP_RENAME:
case LDB_MAP_RENDROP:
@@ -599,7 +600,8 @@ struct ldb_dn *ldb_dn_map_remote(struct ldb_module *module, void *mem_ctx, struc
"used in DN!", ldb_dn_get_component_name(dn, i));
goto failed;
}
- /* fall through */
+
+ FALL_THROUGH;
case LDB_MAP_KEEP:
case LDB_MAP_RENAME:
case LDB_MAP_RENDROP:
--
2.15.1
>From 899e49583d19a90f06c53f519c9b981000a5a3e7 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 15:20:04 +0200
Subject: [PATCH 08/59] lib:ldb: Add FALL_THROUGH statements in
ldb_map/ldb_map_outbound.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/ldb/ldb_map/ldb_map_outbound.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/ldb/ldb_map/ldb_map_outbound.c b/lib/ldb/ldb_map/ldb_map_outbound.c
index fd25c3658da..1f1a7e80142 100644
--- a/lib/ldb/ldb_map/ldb_map_outbound.c
+++ b/lib/ldb/ldb_map/ldb_map_outbound.c
@@ -330,7 +330,8 @@ static int ldb_msg_el_merge(struct ldb_module *module, struct ldb_message *local
attr_name);
return LDB_SUCCESS;
}
- /* fall through */
+
+ FALL_THROUGH;
case LDB_MAP_KEEP:
case LDB_MAP_RENAME:
case LDB_MAP_RENDROP:
--
2.15.1
>From 2a782cf183aa389cfc8456fbb96394a61fcea182 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 15:20:57 +0200
Subject: [PATCH 09/59] lib:param: Add FALL_THROUGH statements in loadparm.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/param/loadparm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 73b7901d7f6..5c17eb33e40 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2058,7 +2058,8 @@ void lpcfg_print_parameter(struct parm_struct *p, void *ptr, FILE * f)
case P_CMDLIST:
list_sep = " ";
- /* fall through */
+
+ FALL_THROUGH;
case P_LIST:
if ((char ***)ptr && *(char ***)ptr) {
char **list = *(char ***)ptr;
--
2.15.1
>From 8f7f1cb25886d5a4c686f1f69ba5397b81536bc5 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 16:49:50 +0200
Subject: [PATCH 10/59] lib:util: Add FALL_THROUGH statements in substitute.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/util/substitute.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/util/substitute.c b/lib/util/substitute.c
index 49adeaf178a..2c18257da25 100644
--- a/lib/util/substitute.c
+++ b/lib/util/substitute.c
@@ -84,6 +84,7 @@ static void string_sub2(char *s,const char *pattern, const char *insert, size_t
p[i] = insert[i];
break;
}
+ FALL_THROUGH;
case '`':
case '"':
case '\'':
@@ -98,6 +99,7 @@ static void string_sub2(char *s,const char *pattern, const char *insert, size_t
* not replacing unsafe chars */
break;
}
+ FALL_THROUGH;
default:
p[i] = insert[i];
}
--
2.15.1
>From 3aa3e3c0b5727b8f202fe66376e0b8065d360b58 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:40:14 +0200
Subject: [PATCH 11/59] lib:util: Add FALL_THROUGH statements in
charset/charset_macosxfs.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/util/charset/charset_macosxfs.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/util/charset/charset_macosxfs.c b/lib/util/charset/charset_macosxfs.c
index 895277d001a..24e21fd6d2c 100644
--- a/lib/util/charset/charset_macosxfs.c
+++ b/lib/util/charset/charset_macosxfs.c
@@ -457,10 +457,11 @@ static size_t macosxfs_encoding_pull(
switch(result) {
case kCFStringEncodingConversionSuccess:
- if (*inbytesleft == srcCharsUsed)
+ if (*inbytesleft == srcCharsUsed) {
break;
- else
- ; /*fall through*/
+ }
+
+ FALL_THROUGH;
case kCFStringEncodingInsufficientOutputBufferLength:
debug_out("String conversion: "
"Output buffer too small\n");
@@ -546,10 +547,11 @@ static size_t macosxfs_encoding_push(
switch(result) {
case kCFStringEncodingConversionSuccess:
- if (*inbytesleft/2 == srcCharsUsed)
+ if (*inbytesleft/2 == srcCharsUsed) {
break;
- else
- ; /*fall through*/
+ }
+
+ FALL_THROUGH;
case kCFStringEncodingInsufficientOutputBufferLength:
debug_out("String conversion: "
"Output buffer too small\n");
--
2.15.1
>From d29370e3b2cbe19a20b969f7c0b398609aa9ad67 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:41:25 +0200
Subject: [PATCH 12/59] lib:util: Add FALL_THROUGH statements in util_file.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/util/util_file.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index ac8206008a3..499e8c46693 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -130,7 +130,8 @@ char *fgets_slash(TALLOC_CTX *mem_ctx, char *s2, int maxlen, FILE *f)
if (start_of_line) {
break;
}
- /* fall through */
+
+ FALL_THROUGH;
default:
start_of_line = false;
s[len++] = c;
--
2.15.1
>From 34a5e6755afd32f419a03699304303b85ac09de6 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:22:44 +0200
Subject: [PATCH 13/59] s3:lib: Add FALL_THROUGH statements in
substitute_generic.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/lib/substitute_generic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source3/lib/substitute_generic.c b/source3/lib/substitute_generic.c
index f24608eb96c..0498cd03833 100644
--- a/source3/lib/substitute_generic.c
+++ b/source3/lib/substitute_generic.c
@@ -68,6 +68,7 @@ char *realloc_string_sub2(char *string,
if (allow_trailing_dollar && (i == li - 1 )) {
break;
}
+ FALL_THROUGH;
case '`':
case '"':
case '\'':
@@ -79,6 +80,7 @@ char *realloc_string_sub2(char *string,
in[i] = '_';
break;
}
+ FALL_THROUGH;
default:
/* ok */
break;
--
2.15.1
>From b271c45e29963a25cb7718c2363f82085d94cc7c Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 16:57:38 +0200
Subject: [PATCH 14/59] s3:lib: Add FALL_THROUGH statements in util_path.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/lib/util_path.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/source3/lib/util_path.c b/source3/lib/util_path.c
index 6f58a03ae58..5b133dfdc78 100644
--- a/source3/lib/util_path.c
+++ b/source3/lib/util_path.c
@@ -204,16 +204,20 @@ char *canonicalize_absolute_path(TALLOC_CTX *ctx, const char *abs_path)
switch(siz) {
case 5:
*d++ = *s++;
- /*fall through*/
+
+ FALL_THROUGH;
case 4:
*d++ = *s++;
- /*fall through*/
+
+ FALL_THROUGH;
case 3:
*d++ = *s++;
- /*fall through*/
+
+ FALL_THROUGH;
case 2:
*d++ = *s++;
- /*fall through*/
+
+ FALL_THROUGH;
case 1:
*d++ = *s++;
break;
--
2.15.1
>From dccfac386f3a78838551cc6425fc1fc35de3d7e8 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:25:20 +0200
Subject: [PATCH 15/59] s3:lib: Add FALL_THROUGH statements in util_str.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/lib/util_str.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 48e434f777e..eb36478d8a2 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -276,6 +276,8 @@ char *talloc_string_sub2(TALLOC_CTX *mem_ctx, const char *src,
if (allow_trailing_dollar && (i == li - 1 )) {
break;
}
+
+ FALL_THROUGH;
case '`':
case '"':
case '\'':
@@ -287,6 +289,8 @@ char *talloc_string_sub2(TALLOC_CTX *mem_ctx, const char *src,
in[i] = '_';
break;
}
+
+ FALL_THROUGH;
default:
/* ok */
break;
--
2.15.1
>From bf372d91c197acbf3646f961f4e9602d8f9cfcb8 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 16:55:10 +0200
Subject: [PATCH 16/59] lib:tdb: Add FALL_THROUGH statements in hash.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/tdb/common/hash.c | 50 +++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/lib/tdb/common/hash.c b/lib/tdb/common/hash.c
index 1eed7221d2a..4de7ba94d2c 100644
--- a/lib/tdb/common/hash.c
+++ b/lib/tdb/common/hash.c
@@ -232,16 +232,16 @@ static uint32_t hashlittle( const void *key, size_t length )
switch(length)
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
- case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
- case 10: c+=((uint32_t)k8[9])<<8; /* fall through */
- case 9 : c+=k8[8]; /* fall through */
+ case 11: c+=((uint32_t)k8[10])<<16; FALL_THROUGH;
+ case 10: c+=((uint32_t)k8[9])<<8; FALL_THROUGH;
+ case 9 : c+=k8[8]; FALL_THROUGH;
case 8 : b+=k[1]; a+=k[0]; break;
- case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
- case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */
- case 5 : b+=k8[4]; /* fall through */
+ case 7 : b+=((uint32_t)k8[6])<<16; FALL_THROUGH;
+ case 6 : b+=((uint32_t)k8[5])<<8; FALL_THROUGH;
+ case 5 : b+=k8[4]; FALL_THROUGH;
case 4 : a+=k[0]; break;
- case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
- case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */
+ case 3 : a+=((uint32_t)k8[2])<<16; FALL_THROUGH;
+ case 2 : a+=((uint32_t)k8[1])<<8; FALL_THROUGH;
case 1 : a+=k8[0]; break;
case 0 : return c;
}
@@ -268,23 +268,23 @@ static uint32_t hashlittle( const void *key, size_t length )
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
+ case 11: c+=((uint32_t)k8[10])<<16; FALL_THROUGH;
case 10: c+=k[4];
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 9 : c+=k8[8]; /* fall through */
+ case 9 : c+=k8[8]; FALL_THROUGH;
case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
+ case 7 : b+=((uint32_t)k8[6])<<16; FALL_THROUGH;
case 6 : b+=k[2];
a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 5 : b+=k8[4]; /* fall through */
+ case 5 : b+=k8[4]; FALL_THROUGH;
case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
break;
- case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
+ case 3 : a+=((uint32_t)k8[2])<<16; FALL_THROUGH;
case 2 : a+=k[0];
break;
case 1 : a+=k8[0];
@@ -316,19 +316,19 @@ static uint32_t hashlittle( const void *key, size_t length )
}
/*-------------------------------- last block: affect all 32 bits of (c) */
- switch(length) /* all the case statements fall through */
+ switch(length)
{
- case 12: c+=((uint32_t)k[11])<<24;
- case 11: c+=((uint32_t)k[10])<<16;
- case 10: c+=((uint32_t)k[9])<<8;
- case 9 : c+=k[8];
- case 8 : b+=((uint32_t)k[7])<<24;
- case 7 : b+=((uint32_t)k[6])<<16;
- case 6 : b+=((uint32_t)k[5])<<8;
- case 5 : b+=k[4];
- case 4 : a+=((uint32_t)k[3])<<24;
- case 3 : a+=((uint32_t)k[2])<<16;
- case 2 : a+=((uint32_t)k[1])<<8;
+ case 12: c+=((uint32_t)k[11])<<24; FALL_THROUGH;
+ case 11: c+=((uint32_t)k[10])<<16; FALL_THROUGH;
+ case 10: c+=((uint32_t)k[9])<<8; FALL_THROUGH;
+ case 9 : c+=k[8]; FALL_THROUGH;
+ case 8 : b+=((uint32_t)k[7])<<24; FALL_THROUGH;
+ case 7 : b+=((uint32_t)k[6])<<16; FALL_THROUGH;
+ case 6 : b+=((uint32_t)k[5])<<8; FALL_THROUGH;
+ case 5 : b+=k[4]; FALL_THROUGH;
+ case 4 : a+=((uint32_t)k[3])<<24; FALL_THROUGH;
+ case 3 : a+=((uint32_t)k[2])<<16; FALL_THROUGH;
+ case 2 : a+=((uint32_t)k[1])<<8; FALL_THROUGH;
case 1 : a+=k[0];
break;
case 0 : return c;
--
2.15.1
>From 88d5c1ba717cf0081f263c79c5d068316c15f0b5 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 16:58:00 +0200
Subject: [PATCH 17/59] lib:tdb: Add FALL_THROUGH statements in tdbtool.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/tdb/tools/tdbtool.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/tdb/tools/tdbtool.c b/lib/tdb/tools/tdbtool.c
index e3535b93c7c..d8bacdb61b8 100644
--- a/lib/tdb/tools/tdbtool.c
+++ b/lib/tdb/tools/tdbtool.c
@@ -930,10 +930,13 @@ int main(int argc, char *argv[])
break;
case 5:
arg2 = tdb_convert_string(argv[4],&arg2len);
+ FALL_THROUGH;
case 4:
arg1 = tdb_convert_string(argv[3],&arg1len);
+ FALL_THROUGH;
case 3:
cmdname = argv[2];
+ FALL_THROUGH;
default:
do_command();
break;
--
2.15.1
>From 7b511bf399f1298aea480d4e02d6c8ce6c575a87 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:28:12 +0200
Subject: [PATCH 18/59] lib:tdb: Add FALL_THROUGH statements in
common/summary.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
lib/tdb/common/summary.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/tdb/common/summary.c b/lib/tdb/common/summary.c
index d786132d4a1..c9b5bc4c1d0 100644
--- a/lib/tdb/common/summary.c
+++ b/lib/tdb/common/summary.c
@@ -151,7 +151,8 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
rec.rec_len = tdb_dead_space(tdb, off)
- sizeof(rec);
}
- /* Fall through */
+
+ FALL_THROUGH;
case TDB_DEAD_MAGIC:
tally_add(&dead, rec.rec_len);
break;
--
2.15.1
>From 9f510156952e5ac953dc28cef847e80a05afe304 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:43:53 +0200
Subject: [PATCH 19/59] libgpo: Add FALL_THROUGH statements in gpo_sec.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
libgpo/gpo_sec.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libgpo/gpo_sec.c b/libgpo/gpo_sec.c
index af73697e56e..98ee8eb3cc9 100644
--- a/libgpo/gpo_sec.c
+++ b/libgpo/gpo_sec.c
@@ -47,13 +47,15 @@ static bool gpo_sd_check_agp_object_guid(const struct security_ace_object *objec
&ext_right_apg_guid)) {
return true;
}
- /* FALL TROUGH */
+
+ FALL_THROUGH;
case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
if (GUID_equal(&object->inherited_type.inherited_type,
&ext_right_apg_guid)) {
return true;
}
- /* FALL TROUGH */
+
+ FALL_THROUGH;
default:
break;
}
--
2.15.1
>From 9bc0594d073a6a01dacff5fddbbce2bf35404692 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:03:09 +0200
Subject: [PATCH 20/59] librpc:ndr: Add FALL_THROUGH statements in ndr_cab.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
librpc/ndr/ndr_cab.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/librpc/ndr/ndr_cab.c b/librpc/ndr/ndr_cab.c
index 837ed253065..c415bfab34c 100644
--- a/librpc/ndr/ndr_cab.c
+++ b/librpc/ndr/ndr_cab.c
@@ -95,10 +95,13 @@ static uint32_t ndr_cab_compute_checksum(uint8_t *data, uint32_t length, uint32_
switch (length % 4) {
case 3:
ul |= (((uint32_t)(*pb++)) << 16);
+ FALL_THROUGH;
case 2:
ul |= (((uint32_t)(*pb++)) << 8);
+ FALL_THROUGH;
case 1:
ul |= (uint32_t)(*pb++);
+ FALL_THROUGH;
default:
break;
}
--
2.15.1
>From 7d58455dce3adabe4077a45c013519ce4484ee43 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:35:28 +0200
Subject: [PATCH 21/59] s3:auth: Add FALL_THROUGH statements in auth_sam.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/auth/auth_sam.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c
index 4bcb7926c6e..46958c54d3a 100644
--- a/source3/auth/auth_sam.c
+++ b/source3/auth/auth_sam.c
@@ -88,6 +88,8 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
? "ROLE_DOMAIN_MEMBER" : "ROLE_STANDALONE") ));
return NT_STATUS_NOT_IMPLEMENTED;
}
+
+ FALL_THROUGH;
case ROLE_DOMAIN_PDC:
case ROLE_DOMAIN_BDC:
if ( !is_local_name && !is_my_domain ) {
@@ -95,6 +97,8 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
user_info->mapped.domain_name));
return NT_STATUS_NOT_IMPLEMENTED;
}
+
+ FALL_THROUGH;
default: /* name is ok */
break;
}
--
2.15.1
>From 02dfcbbc479f09970218b51c5c47d3fa1a19ffd0 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 16:55:23 +0200
Subject: [PATCH 22/59] s3:auth: Add FALL_THROUGH statements in pampass.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/auth/pampass.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c
index 1a82fe7f203..8cb894482ae 100644
--- a/source3/auth/pampass.c
+++ b/source3/auth/pampass.c
@@ -168,7 +168,7 @@ static int smb_pam_conv(int num_msg,
break;
case PAM_TEXT_INFO:
- /* fall through */
+ FALL_THROUGH;
case PAM_ERROR_MSG:
/* ignore it... */
@@ -390,7 +390,7 @@ static int smb_pam_passchange_conv(int num_msg,
break;
case PAM_TEXT_INFO:
- /* fall through */
+ FALL_THROUGH;
case PAM_ERROR_MSG:
/* ignore it... */
--
2.15.1
>From f7919d2eba22f18cc24da9bbd71579b808892d2d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:25:30 +0200
Subject: [PATCH 23/59] s3:lib: Add FALL_THROUGH statements in cbuf.c
---
source3/lib/cbuf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source3/lib/cbuf.c b/source3/lib/cbuf.c
index 611aa80609f..426ecdb5a3b 100644
--- a/source3/lib/cbuf.c
+++ b/source3/lib/cbuf.c
@@ -278,7 +278,8 @@ int cbuf_print_quoted_string(cbuf* ost, const char* s)
case '\\':
cbuf_putc(ost, '\\');
n++;
- /* no break */
+
+ FALL_THROUGH;
default:
cbuf_putc(ost, *s);
n++;
--
2.15.1
>From 18d16595c3c1ec2ef9aeba93f9251603e0e08d8c Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:48:34 +0200
Subject: [PATCH 24/59] REVIEW CARFULLY s3:lib: Add missing break in tldap.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/lib/tldap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index 40064fdeeed..33a852446b9 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -1295,6 +1295,8 @@ static bool tldap_unescape_inplace(char *value, size_t *val_len)
case '\\':
value[p] = value[i];
p++;
+
+ break;
default:
/* invalid */
return false;
--
2.15.1
>From dd079f81d754b646e60dc27f3709d08c3d8325fa Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:51:08 +0200
Subject: [PATCH 25/59] s3:lib: Add FALL_THROUGH statements in sysacls.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/lib/sysacls.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c
index 0bf3c37edfa..c80f8f30c90 100644
--- a/source3/lib/sysacls.c
+++ b/source3/lib/sysacls.c
@@ -186,7 +186,8 @@ char *sys_acl_to_text(const struct smb_acl_t *acl_d, ssize_t *len_p)
case SMB_ACL_USER:
id = uidtoname(ap->info.user.uid);
- /* FALL TROUGH */
+
+ FALL_THROUGH;
case SMB_ACL_USER_OBJ:
tag = "user";
break;
@@ -199,7 +200,8 @@ char *sys_acl_to_text(const struct smb_acl_t *acl_d, ssize_t *len_p)
} else {
id = gr->gr_name;
}
- /* FALL TROUGH */
+
+ FALL_THROUGH;
case SMB_ACL_GROUP_OBJ:
tag = "group";
break;
--
2.15.1
>From a79a124054e61705c5397ea630e4826c56a04e81 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:54:48 +0200
Subject: [PATCH 26/59] s3:lib: Add FALL_THROUGH statements in util_sd.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/lib/util_sd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source3/lib/util_sd.c b/source3/lib/util_sd.c
index aa6d4809fc8..39083b15438 100644
--- a/source3/lib/util_sd.c
+++ b/source3/lib/util_sd.c
@@ -394,6 +394,8 @@ static bool parse_ace_flags(const char *str, unsigned int *pflags)
switch (*p) {
case '|':
p++;
+
+ FALL_THROUGH;
case '\0':
continue;
default:
--
2.15.1
>From 1fece1ceba2238eb20e9f028b1678b1ca374c66a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:36:50 +0200
Subject: [PATCH 27/59] s3:libsmb: Add FALL_THROUGH statements in dsgetdcname.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/libsmb/dsgetdcname.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index ce0cc89899c..2b2db2259c3 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -713,6 +713,8 @@ static void map_dc_and_domain_names(uint32_t flags,
*domain_p = domain_name;
break;
}
+
+ FALL_THROUGH;
case DS_RETURN_DNS_NAME:
default:
if (dns_dc_name && dns_domain_name &&
--
2.15.1
>From a13b64cb7d9f72c743097497da4c8b233eb5876d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:53:45 +0200
Subject: [PATCH 28/59] s3:modules: Add FALL_THROUGH statements in
vfs_acl_common.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/modules/vfs_acl_common.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index 546e97b9b5d..b323079d08a 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -519,6 +519,7 @@ static NTSTATUS validate_nt_acl_blob(TALLOC_CTX *mem_ctx,
}
/* Otherwise, fall though and see if the NT ACL hash matches */
+ FALL_THROUGH;
}
case 3:
/* Get the full underlying sd for the hash
--
2.15.1
>From e577d5a22eb355eb5935ef212eb7ee6e38bc9569 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:50:18 +0200
Subject: [PATCH 29/59] s3:smbd: Add FALL_THROUGH statements in nttrans.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/smbd/nttrans.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 7b7f2056099..ca02dbcc3d9 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -2387,6 +2387,7 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
start_enum = False;
+ FALL_THROUGH;
case TRANSACT_GET_USER_QUOTA_LIST_START:
if (qt_handle->quota_list==NULL &&
--
2.15.1
>From fa07ba36acdb179f3c64ab75bf597b564ecded5a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:52:06 +0200
Subject: [PATCH 30/59] s3:smbd: Add FALL_THROUGH statements in trans2.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/smbd/trans2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index dbad71be3b7..a1eea471d23 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4032,7 +4032,8 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
SIVAL(pdata,84,0x100); /* Don't support mac... */
break;
}
- /* drop through */
+
+ FALL_THROUGH;
default:
return NT_STATUS_INVALID_LEVEL;
}
--
2.15.1
>From f41b9e5ceb653112eb87bf3ae010a350f23d6ed3 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:55:35 +0200
Subject: [PATCH 31/59] s3:utils: Add FALL_THROUGH statements in regedit.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/utils/regedit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c
index 14e75c25bfa..27bd6f8f2c2 100644
--- a/source3/utils/regedit.c
+++ b/source3/utils/regedit.c
@@ -507,7 +507,8 @@ static void handle_value_input(struct regedit *regedit, int c)
case 'b':
case 'B':
binmode = true;
- /* Falthrough... */
+
+ FALL_THROUGH;
case '\n':
case KEY_ENTER:
vitem = value_list_get_current_item(regedit->vl);
--
2.15.1
>From 9b0918ff6de87342dd5124ae19eb7a95b2511956 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:57:10 +0200
Subject: [PATCH 32/59] s3:utils: Add FALL_THROUGH statements in net_conf.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/utils/net_conf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 8d9f1e6b99b..097baa1b82e 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -294,6 +294,8 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx,
d_printf(_("error: out of memory!\n"));
goto done;
}
+
+ FALL_THROUGH;
case 1:
filename = argv[0];
break;
@@ -563,6 +565,8 @@ static int net_conf_addshare(struct net_context *c,
goto done;
case 5:
comment = argv[4];
+
+ FALL_THROUGH;
case 4:
if (!strnequal(argv[3], "guest_ok=", 9)) {
net_conf_addshare_usage(c, argc, argv);
@@ -581,6 +585,8 @@ static int net_conf_addshare(struct net_context *c,
net_conf_addshare_usage(c, argc, argv);
goto done;
}
+
+ FALL_THROUGH;
case 3:
if (!strnequal(argv[2], "writeable=", 10)) {
net_conf_addshare_usage(c, argc, argv);
@@ -599,6 +605,8 @@ static int net_conf_addshare(struct net_context *c,
net_conf_addshare_usage(c, argc, argv);
goto done;
}
+
+ FALL_THROUGH;
case 2:
path = argv[1];
sharename = talloc_strdup(mem_ctx, argv[0]);
--
2.15.1
>From ca8cd8b7d5e9d70fd327fd99c9683bfa780b8f81 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:58:40 +0200
Subject: [PATCH 33/59] s3:utils: Add FALL_THROUGH statements in net_rpc_conf.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/utils/net_rpc_conf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/source3/utils/net_rpc_conf.c b/source3/utils/net_rpc_conf.c
index 0b1b59e3b45..4747da98325 100644
--- a/source3/utils/net_rpc_conf.c
+++ b/source3/utils/net_rpc_conf.c
@@ -1155,6 +1155,8 @@ static NTSTATUS rpc_conf_import_internal(struct net_context *c,
d_printf(_("error: out of memory!\n"));
goto error;
}
+
+ FALL_THROUGH;
case 1:
filename = argv[0];
break;
@@ -1426,6 +1428,8 @@ static NTSTATUS rpc_conf_addshare_internal(struct net_context *c,
goto error;
case 5:
comment = argv[4];
+
+ FALL_THROUGH;
case 4:
if (!strnequal(argv[3], "guest_ok=", 9)) {
rpc_conf_addshare_usage(c, argc, argv);
@@ -1446,6 +1450,8 @@ static NTSTATUS rpc_conf_addshare_internal(struct net_context *c,
status = NT_STATUS_INVALID_PARAMETER;
goto error;
}
+
+ FALL_THROUGH;
case 3:
if (!strnequal(argv[2], "writeable=", 10)) {
rpc_conf_addshare_usage(c, argc, argv);
@@ -1466,6 +1472,8 @@ static NTSTATUS rpc_conf_addshare_internal(struct net_context *c,
status = NT_STATUS_INVALID_PARAMETER;
goto error;
}
+
+ FALL_THROUGH;
case 2:
path = argv[1];
sharename = talloc_strdup(frame, argv[0]);
--
2.15.1
>From cc51acd0aec9d9b17e6151908790dd61293297fe Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:42:46 +0200
Subject: [PATCH 34/59] s3:rpc_server: Add FALL_THROUGH statements in
rpc_server.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/rpc_server/rpc_server.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c
index e15cd205cdc..495209b0d73 100644
--- a/source3/rpc_server/rpc_server.c
+++ b/source3/rpc_server/rpc_server.c
@@ -1065,7 +1065,8 @@ void dcerpc_ncacn_accept(struct tevent_context *ev_ctx,
}
}
}
- /* FALL TROUGH */
+
+ FALL_THROUGH;
case NCACN_NP:
pipe_name = talloc_strdup(ncacn_conn,
name);
--
2.15.1
>From ef9c593fea915e2524e83e3a5adeb3ae6885aa40 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:21:02 +0200
Subject: [PATCH 35/59] s4:samdb: Add FALL_THROUGH statements in cracknames.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/dsdb/samdb/cracknames.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index d43f510b949..d8fe0975d15 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -1083,7 +1083,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_
return WERR_OK;
}
}
- /* FALL TROUGH */
+ FALL_THROUGH;
default:
info1->status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE;
return WERR_OK;
--
2.15.1
>From d26c7c4c4ec4f25137e45b35f4a1bb63fc993e1d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:28:11 +0200
Subject: [PATCH 36/59] s4:samdb: Add FALL_THROUGH statements in
linked_attributes.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/dsdb/samdb/ldb_modules/linked_attributes.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index c6beb25e58b..57d25076a75 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -573,8 +573,7 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques
/* treat as just a normal add the delete part is handled by the callback */
store_el = true;
- /* break intentionally missing */
-
+ FALL_THROUGH;
case LDB_FLAG_MOD_ADD:
/* For each value being added, we need to setup the adds */
--
2.15.1
>From 0a1832c9028305e16e2e6abecc96874eb307541d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:29:55 +0200
Subject: [PATCH 37/59] s4:auth: Add FALL_THROUGH statements in auth_util.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/auth/ntlm/auth_util.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/source4/auth/ntlm/auth_util.c b/source4/auth/ntlm/auth_util.c
index 7feb20b8f62..5084cc4a929 100644
--- a/source4/auth/ntlm/auth_util.c
+++ b/source4/auth/ntlm/auth_util.c
@@ -62,7 +62,8 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth4_context *auth_conte
return nt_status;
}
user_info_in = user_info_temp2;
- /* fall through */
+
+ FALL_THROUGH;
}
case AUTH_PASSWORD_HASH:
{
@@ -122,7 +123,8 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth4_context *auth_conte
}
user_info_in = user_info_temp;
- /* fall through */
+
+ FALL_THROUGH;
}
case AUTH_PASSWORD_RESPONSE:
*user_info_encrypted = user_info_in;
@@ -160,7 +162,8 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth4_context *auth_conte
*user_info_temp->password.hash.nt = nt;
user_info_in = user_info_temp;
- /* fall through */
+
+ FALL_THROUGH;
}
case AUTH_PASSWORD_HASH:
*user_info_encrypted = user_info_in;
--
2.15.1
>From 6bf1461c83b90e2c7f64c18816ea472a1c3d4bad Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:30:53 +0200
Subject: [PATCH 38/59] s4:auth: Add FALL_THROUGH statements in auth_sam.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/auth/ntlm/auth_sam.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/auth/ntlm/auth_sam.c b/source4/auth/ntlm/auth_sam.c
index 24fe1677ed3..bbbb1cb97c7 100644
--- a/source4/auth/ntlm/auth_sam.c
+++ b/source4/auth/ntlm/auth_sam.c
@@ -70,7 +70,7 @@ static NTSTATUS authsam_password_ok(struct auth4_context *auth_context,
}
user_info = user_info_temp;
- /*fall through*/
+ FALL_THROUGH;
}
case AUTH_PASSWORD_HASH:
*lm_sess_key = data_blob(NULL, 0);
--
2.15.1
>From b165c3bcf88adbd541904363808f6ef97d711411 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:33:12 +0200
Subject: [PATCH 39/59] s4:auth: Add FALL_THROUGH statements in gensec_krb5.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/auth/gensec/gensec_krb5.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index 86ec23fe433..0323da87d29 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -407,12 +407,9 @@ static NTSTATUS gensec_krb5_common_client_creds(struct gensec_security *gensec_s
/* Too much clock skew - we will need to kinit to re-skew the clock */
case KRB5KRB_AP_ERR_SKEW:
case KRB5_KDCREP_SKEW:
- {
DEBUG(3, ("kerberos (mk_req) failed: %s\n",
smb_get_krb5_error_message(gensec_krb5_state->smb_krb5_context->krb5_context, ret, gensec_krb5_state)));
- /*fall through*/
- }
-
+ FALL_THROUGH;
/* just don't print a message for these really ordinary messages */
case KRB5_FCC_NOFILE:
case KRB5_CC_NOTFOUND:
--
2.15.1
>From 5039aeee17704ff3a48616b0d73cd48b7035a343 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:39:04 +0200
Subject: [PATCH 40/59] s4:rpc_server: Add FALL_THROUGH statements in
dcesrv_srvsvc.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/rpc_server/srvsvc/dcesrv_srvsvc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
index 4dd3e977b68..a6bee0d8ca0 100644
--- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
+++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
@@ -1127,6 +1127,7 @@ static WERROR dcesrv_srvsvc_fill_share_info(struct share_info *info, int *count,
*((int *)info[i].value) = max_users;
i++;
+ FALL_THROUGH;
case 501:
case 1:
info[i].name = SHARE_TYPE;
@@ -1147,6 +1148,7 @@ static WERROR dcesrv_srvsvc_fill_share_info(struct share_info *info, int *count,
W_ERROR_HAVE_NO_MEMORY(info[i].value);
i++;
+ FALL_THROUGH;
case 1004:
if (comment) {
info[i].name = SHARE_COMMENT;
@@ -1156,6 +1158,8 @@ static WERROR dcesrv_srvsvc_fill_share_info(struct share_info *info, int *count,
i++;
}
+
+ FALL_THROUGH;
case 0:
if (name &&
strcasecmp(share_name, name) != 0) {
--
2.15.1
>From c1fc7f2386a742dca717d409caccf82c057294dd Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:39:52 +0200
Subject: [PATCH 41/59] s4:torture: Add FALL_THROUGH statements in basic/misc.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/torture/basic/misc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c
index 68b7cbec812..25ae4560de8 100644
--- a/source4/torture/basic/misc.c
+++ b/source4/torture/basic/misc.c
@@ -985,6 +985,8 @@ bool run_benchrw(struct torture_context *tctx)
break;
}
state[i]->mode=FINISHED;
+
+ FALL_THROUGH;
case FINISHED:
finished++;
break;
--
2.15.1
>From 16460c15b9e5229233b7d98a59a1bb2551c61e2f Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 17:41:26 +0200
Subject: [PATCH 42/59] s4:torture: Add FALL_THROUGH statements in
rpc/spoolss.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/torture/rpc/spoolss.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 31b9525ee62..91f32692042 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -1402,6 +1402,8 @@ static bool test_SetPrinter_errors(struct torture_context *tctx,
/* ignored then */
break;
}
+
+ FALL_THROUGH;
case SPOOLSS_PRINTER_CONTROL_PAUSE: /* 1 */
case SPOOLSS_PRINTER_CONTROL_RESUME: /* 2 */
case SPOOLSS_PRINTER_CONTROL_PURGE: /* 3 */
--
2.15.1
>From 68e5373d2761ba0bbaa312a551c67057fa6e0deb Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:20:53 +0200
Subject: [PATCH 43/59] auth:credentials: Add FALL_THROUGH statements in
credentials.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
auth/credentials/credentials.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 4f3042e3152..4663185c979 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -1277,17 +1277,21 @@ _PUBLIC_ bool cli_credentials_parse_password_fd(struct cli_credentials *credenti
*++p = '\0'; /* advance p, and null-terminate pass */
break;
}
- /* fall through */
+
+ FALL_THROUGH;
case 0:
if (p - pass) {
*p = '\0'; /* null-terminate it, just in case... */
p = NULL; /* then force the loop condition to become false */
break;
- } else {
- fprintf(stderr, "Error reading password from file descriptor %d: %s\n", fd, "empty password\n");
- return false;
}
+ fprintf(stderr,
+ "Error reading password from file descriptor "
+ "%d: empty password\n",
+ fd);
+ return false;
+
default:
fprintf(stderr, "Error reading password from file descriptor %d: %s\n",
fd, strerror(errno));
--
2.15.1
>From 60e1fc7819f9016d65daf319e1606e5916762dea Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:23:31 +0200
Subject: [PATCH 44/59] auth:credentials: Add FALL_THROUGH statements in
credentials_secrets.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
auth/credentials/credentials_secrets.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/auth/credentials/credentials_secrets.c b/auth/credentials/credentials_secrets.c
index ed148fd3566..23981bd318c 100644
--- a/auth/credentials/credentials_secrets.c
+++ b/auth/credentials/credentials_secrets.c
@@ -369,7 +369,8 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account_db_ctx(struct cli_credenti
if (security != SEC_ADS) {
break;
}
- /* fall through */
+
+ FALL_THROUGH;
case ROLE_ACTIVE_DIRECTORY_DC:
use_kerberos = CRED_AUTO_USE_KERBEROS;
break;
--
2.15.1
>From cec10e7ce88cb022750b65c906a5e3c90ac27a37 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 18:24:26 +0200
Subject: [PATCH 45/59] auth:gensec: Add FALL_THROUGH statements in spnego.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
auth/gensec/spnego.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/auth/gensec/spnego.c b/auth/gensec/spnego.c
index 9857e78184b..7913466e14c 100644
--- a/auth/gensec/spnego.c
+++ b/auth/gensec/spnego.c
@@ -1646,7 +1646,7 @@ static struct tevent_req *gensec_spnego_update_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- /* fall through */
+ FALL_THROUGH;
case SPNEGO_CLIENT_START:
case SPNEGO_SERVER_START:
--
2.15.1
>From 9578a7e0298a939240a64ebc0dc8889290a82b53 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 16:56:27 +0200
Subject: [PATCH 46/59] nsswitch: Add FALL_THROUGH statements in pam_winbind.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
nsswitch/pam_winbind.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index e14fcfeb263..63fede87c78 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -2886,7 +2886,8 @@ int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags,
ret = atoi(tmp);
switch (ret) {
case PAM_AUTHTOK_EXPIRED:
- /* fall through, since new token is required in this case */
+ /* Since new token is required in this case */
+ FALL_THROUGH;
case PAM_NEW_AUTHTOK_REQD:
_pam_log(ctx, LOG_WARNING,
"pam_sm_acct_mgmt success but %s is set",
--
2.15.1
>From 2e6ffd12f8f8e05bf16f61411b19138924ee9925 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 27 Jul 2017 16:59:40 +0200
Subject: [PATCH 47/59] s3:libnet: Add FALL_THROUGH statements in libnet_join.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/libnet/libnet_join.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 0595cfe64ab..9b1bf342c19 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -2418,7 +2418,8 @@ static WERROR libnet_join_check_config(TALLOC_CTX *mem_ctx,
valid_realm = true;
ignored_realm = true;
}
- /* FALL THROUGH */
+
+ FALL_THROUGH;
case SEC_ADS:
valid_security = true;
}
--
2.15.1
>From f57ceeac0cd70471fcc6c8ed86384b249dee4fdd Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:08:36 +0200
Subject: [PATCH 48/59] s3:modules: Add FALL_THROUGH statements in getdate.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/modules/getdate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/source3/modules/getdate.c b/source3/modules/getdate.c
index 6ed994649c4..2879bc87f4b 100644
--- a/source3/modules/getdate.c
+++ b/source3/modules/getdate.c
@@ -1098,9 +1098,10 @@ yytnamerr (char *yyres, const char *yystr)
goto do_not_strip_quotes;
case '\\':
- if (*++yyp != '\\')
+ if (*++yyp != '\\') {
goto do_not_strip_quotes;
- /* Fall through. */
+ }
+ FALL_THROUGH;
default:
if (yyres)
yyres[yyn] = *yyp;
--
2.15.1
>From 93b899317cefbeaf4cacd9f8e1c279a30d5a131a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:12:43 +0200
Subject: [PATCH 49/59] s3:lsa: Add FALL_THROUGH statements in srv_lsa_nt.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/rpc_server/lsa/srv_lsa_nt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c
index 3cc87ad9081..a3254a61667 100644
--- a/source3/rpc_server/lsa/srv_lsa_nt.c
+++ b/source3/rpc_server/lsa/srv_lsa_nt.c
@@ -4288,11 +4288,13 @@ static NTSTATUS check_ft_info(TALLOC_CTX *mem_ctx,
exclusion = true;
break;
}
- /* fall through */
+
+ FALL_THROUGH;
case DNS_CMP_FIRST_IS_CHILD:
case DNS_CMP_SECOND_IS_CHILD:
tln_conflict = true;
- /* fall through */
+
+ FALL_THROUGH;
default:
break;
}
--
2.15.1
>From 4acba5b6816179517ff30dbf2a80c9a35d0bb837 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:13:42 +0200
Subject: [PATCH 50/59] s3:rpcclient: Add FALL_THROUGH statements in
rpcclient.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/rpcclient/rpcclient.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index c1039ed84c5..4eb1e145715 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -744,7 +744,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
use_kerberos = CRED_AUTO_USE_KERBEROS;
break;
}
- /* Fall through */
+ FALL_THROUGH;
case DCERPC_AUTH_TYPE_NTLMSSP:
case DCERPC_AUTH_TYPE_KRB5:
ntresult = cli_rpc_pipe_open_generic_auth(
--
2.15.1
>From 800e01f3fe29d60a2491d1b801e5297edbffbc4b Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:15:31 +0200
Subject: [PATCH 51/59] s3:smbd: Add FALL_THROUGH statements in reply.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/smbd/reply.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 623f83b1250..881667a6b44 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -190,16 +190,16 @@ static NTSTATUS check_path_syntax_internal(char *path,
switch(siz) {
case 5:
*d++ = *s++;
- /*fall through*/
+ FALL_THROUGH;
case 4:
*d++ = *s++;
- /*fall through*/
+ FALL_THROUGH;
case 3:
*d++ = *s++;
- /*fall through*/
+ FALL_THROUGH;
case 2:
*d++ = *s++;
- /*fall through*/
+ FALL_THROUGH;
case 1:
*d++ = *s++;
break;
--
2.15.1
>From 94209deb3a06dbeda2e3d14b9014dd5a73aced2a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:18:09 +0200
Subject: [PATCH 52/59] s3:utils: Add FALL_THROUGH statements in
net_registry_check.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/utils/net_registry_check.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index de79f3e6af3..2274b739b0d 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -810,7 +810,8 @@ static int check_tdb_action(struct db_record *rec, void *check_ctx)
talloc_free(key);
key = p;
}
- } /* fall through */
+ FALL_THROUGH;
+ }
case 'r': /* retry */
once_more = true;
break;
--
2.15.1
>From ad87b48ff4b0c239aa493573410fa84b9d3cf9e3 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:24:23 +0200
Subject: [PATCH 53/59] s3:utils: Add FALL_THROUGH statements in ntlm_auth.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/utils/ntlm_auth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 3f544902a24..3979d0bf27b 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -1378,7 +1378,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
* NTLMSSP_CLIENT_1 for now.
*/
use_cached_creds = false;
- /* fall through */
+ FALL_THROUGH;
case NTLMSSP_CLIENT_1:
/* setup the client side */
@@ -1474,7 +1474,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
if (!in.length) {
first = true;
}
- /* fall through */
+ FALL_THROUGH;
case SQUID_2_5_NTLMSSP:
nt_status = gensec_start_mech_by_oid(state->gensec_state, GENSEC_OID_NTLMSSP);
break;
--
2.15.1
>From 37835ca994786c20f3e21c563031904676e2d8b4 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:25:27 +0200
Subject: [PATCH 54/59] s3:winbindd: Add FALL_THROUGH statements in
idmap_autorid.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/winbindd/idmap_autorid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index 39027d1511b..65b3d5af222 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -260,7 +260,7 @@ static NTSTATUS idmap_autorid_id_to_sid(struct autorid_global_config *cfg,
}
/* If we end up here, something weird is in the record. */
- /* FALL THROUGH */
+ FALL_THROUGH;
default:
DBG_DEBUG("SID/domain range: %s\n",
(const char *)data.dptr);
--
2.15.1
>From cfef8a9a8e619b3bcb635bd9fbea7d555c4d7c40 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:26:38 +0200
Subject: [PATCH 55/59] s4:dsdb: Add FALL_THROUGH statements in password_hash.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/dsdb/samdb/ldb_modules/password_hash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index c428ff7f359..2e6464f0dd1 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -2241,7 +2241,7 @@ static int setup_last_set_field(struct setup_password_fields_io *io)
if (!io->ac->update_password) {
break;
}
- /* fall through */
+ FALL_THROUGH;
case UINT64_MAX:
if (!io->ac->update_password &&
io->u.pwdLastSet != 0 &&
--
2.15.1
>From b17fd0ae2d88b2ca97cd47bcce28634c497ccaf3 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:27:38 +0200
Subject: [PATCH 56/59] s4:lib: Add FALL_THROUGH statements in http.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source4/lib/http/http.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/lib/http/http.c b/source4/lib/http/http.c
index 659cba0ff14..10b49cd14fe 100644
--- a/source4/lib/http/http.c
+++ b/source4/lib/http/http.c
@@ -117,7 +117,7 @@ static enum http_read_status http_parse_headers(struct http_read_response_state
state->parser_state = HTTP_READING_BODY;
break;
}
- /* fall through */
+ FALL_THROUGH;
case 0:
DEBUG(11, ("%s: Skipping body for code %d\n", __func__,
state->response->response_code));
--
2.15.1
>From 820ab20eb3e1c530451af00fa836113e37c4fa32 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:11:24 +0200
Subject: [PATCH 57/59] s3:spoolss: Remove incorrect fall through comment in
srv_spoolss_nt.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/rpc_server/spoolss/srv_spoolss_nt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index f0226ba9441..e5463683598 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -1804,7 +1804,6 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
DEBUG(4,("Setting print server access = %s\n", (r->in.access_mask == SERVER_ACCESS_ADMINISTER)
? "SERVER_ACCESS_ADMINISTER" : "SERVER_ACCESS_ENUMERATE" ));
- /* We fall through to return WERR_OK */
break;
case SPLHND_PRINTER:
--
2.15.1
>From 742d940753cce1652f43a15c8606a8dbf96c75a8 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 13 Oct 2017 11:06:48 +0200
Subject: [PATCH 58/59] libsmb: Remove incorrect fall through comment in
trusts_util.c
Signed-off-by: Andreas Schneider <asn at samba.org>
---
source3/libsmb/trusts_util.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 27e77e6cc60..1b2c43a0b59 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -82,7 +82,6 @@ char *trust_pw_new_value(TALLOC_CTX *mem_ctx,
min = 120;
max = 120;
break;
- /* fall through */
case SEC_CHAN_DOMAIN:
/*
* The maximum length of a trust account password.
--
2.15.1
>From 7834fa499666c18b8818e6bf0743d1987aab1d56 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 26 Jul 2017 16:29:06 +0200
Subject: [PATCH 59/59] wafsamba: Add -Wimplicit-fallthrough if available
Signed-off-by: Andreas Schneider <asn at samba.org>
---
buildtools/wafsamba/samba_autoconf.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 7940a7d4fe8..64bc9e693d9 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -709,6 +709,8 @@ def SAMBA_CONFIG_H(conf, path=None):
testflags=True)
conf.ADD_CFLAGS('-Werror=uninitialized -Wuninitialized',
testflags=True)
+ conf.ADD_CFLAGS('-Wimplicit-fallthrough',
+ testflags=True)
conf.ADD_CFLAGS('-Wformat=2 -Wno-format-y2k', testflags=True)
conf.ADD_CFLAGS('-Wno-format-zero-length', testflags=True)
--
2.15.1
More information about the samba-technical
mailing list