[PATCHSET] Add support for fall through attribute

Andreas Schneider asn at samba.org
Tue Jan 16 14:11:59 UTC 2018


On Thursday, 21 December 2017 20:00:41 CET Andreas Schneider via samba-
technical wrote:
> I'm not sure. Either you need to remove the p++ and FALL_THROUGH or we have
> to add a break.
> 
> However I think we should make the TLDAP test work which currently fails.

I've talked to Simo, he confirmed that we need to break in this switch 
statement or we stop parsing in the middle. I've also enabled the TLDAP test.

Patch rebased on master ...

Please review and push if OK.

Thanks,

	Andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
>From aa4991e2171486aa059d0c4a0f8e2f2400e78fa2 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/60] 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 ee0ab711fe8f20ff1df09043d9011d153fd62102 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/60] 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 297f0223ced156ee1c99dd1d7345220977edc23f 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/60] 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 2bb7150a9f5c1dc06b4053ecbf1c2a18250c3493 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/60] 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 e963216929cd4d6c24ebb7361ee386b0dd0d4609 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/60] 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 1f1bff17a8554f937251e030dfb70ac0170c1170 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/60] 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 b31f153995cebab18a2466e8040a64a7594590ff 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/60] 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 eecc11fa6507b777e6064c41aa40d562e068e2fe 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/60] 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 ab6a84f6e3422550cfc153e74da5e044f0b03db9 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/60] 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 7854f57a158..68b67af53b2 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 6f0208edfcc86bac9567dcfec706a465468ebb59 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/60] 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 1bac81aed83d0befd07d48cfeff1f84d6b8c00b3 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/60] 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 02d8b62cd7f9aaf6728c9738e8dba7cf1cf8825d 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/60] 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 33fc5ef3936df68522b7abdea049209c77a44e6f 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/60] 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 1be7d898feb2464b545cc4b5bf5bda3c467ede83 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/60] 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 aff4eba2ef06ab37d695b2e5c1dd64e035daa9a3 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/60] 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 bb10ef1d9e45ce6e71f86965dcdf755212e8a4ad 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/60] 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 c2b2a7651abe87bb09a9d14c5a874a16cd901e16 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/60] 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 3088db66e07b243411d92ce09a68c0300edb2fa6 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/60] 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 ef3ffaa85ec8e67274efc60b790230eaa83a1661 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/60] 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 b3a7c9e3d2f2c2f115766bd12816ca9296700079 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/60] 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 4a0abce69c28b50b8fa20833b68b8134fa2474c8 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/60] 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 6a5f3efed23497885ea0a2cd64c55381efa07d08 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/60] 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 98a10b5caae85c1a77e80393d3db983b08bff675 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/60] 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 e1f8ed1174c81f14e8577ded2d6cbda06c984d51 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 24/60] 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 c388b96fc5edf0d60d17768c0d2d4fe945ead4ac 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 25/60] 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 2bfcb104348b86b302024f4a780009c792ac2f10 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 26/60] 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 2788e33bf98870428d6660a0cee3f8a3dd5af99f 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 27/60] 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 38ca2deca86cc90c1fbdfaafb6b087fc525f4f22 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 28/60] 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 9a6d9fff0f477e39093e6891ecdf3693171a683c 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 29/60] 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 512918efc89..b49c3ca7836 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 198c64eea53904086b671935f9aa54079e38cf39 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 30/60] 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 4f731f2df1bfcb86a8299182a1ddc85d0f241c6d 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 31/60] 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 6ff769e7d325021d9b6be5814d787c86a3ba11f7 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 32/60] 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 690cfb0e93efdf1175dc4dbe556adde10097feb2 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 33/60] 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 94335b3ea53..2327e433d8a 100644
--- a/source3/rpc_server/rpc_server.c
+++ b/source3/rpc_server/rpc_server.c
@@ -1068,7 +1068,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 68c2673e7d723784a96a52634947bce80bf71c09 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 34/60] 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 fda137ea5d4e04ae50906eec1b8f4e16538bde5d 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 35/60] 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 782efe0a1acad647e7f81ff60befe61d1ff639c0 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 36/60] 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 f36a1b7f4f18ddab081e7eba76e3da9207009278 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 37/60] 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 5e2a5843fc4..3d8266c4420 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 aca35eb7bf12649f84984adea656e8f1e26f348f 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 38/60] 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 377a7838e1550a8e586d68c5897a21f81b2741ce 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 39/60] 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 41c6cf8fc8e179414601f331229fae916b685b51 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 40/60] 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 3518fcb616774c785f33099bb17682a6954009cd 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 41/60] 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 83b6406945d0ae7b06615b3656be9042f9aeea29 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 42/60] 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 c61650496f2ffcd0cf3c22cfeefe7dcc531b8461 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 43/60] 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 beb292848ad..ae1d23b51c1 100644
--- a/auth/credentials/credentials_secrets.c
+++ b/auth/credentials/credentials_secrets.c
@@ -372,7 +372,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 8bf34fb1b3b497695de099a537bf2e9737e55262 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 44/60] 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 56f9be412ab..0b3fbdce7ac 100644
--- a/auth/gensec/spnego.c
+++ b/auth/gensec/spnego.c
@@ -1649,7 +1649,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 bb7f06b8a25a7ba8ca6767af9f91028df3b65ac1 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 45/60] 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 a5811c8c5970896397ca5a805d80e88f62b3caf8 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 46/60] 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 b0000cb5163c629c1df87e6b164e3a6d4b637cd7 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 47/60] 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 5b52586ad1f8b2e0605a9f0cf338d3a6ae4684bb 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 48/60] 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 ec06747c72aab0723496f7b70d27371ace9ff2fc 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 49/60] 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 585e8d40f1460731b0b9b86291ebd3ad6778e046 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 50/60] 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 2ec2caf341362b227072f75d3924cabf23fbb453 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 51/60] 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 8d6c35ddd0eaf57ef60ae54aa1ad8f5595a968a9 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 52/60] 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 d83c143b36f8a1159205fac41cd178bea3cc0a88 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 53/60] 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 13b77ff1b65f850ef7a08b11e03b4c5c4daf0ad1 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 54/60] 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 4802f199d375ebf14d3175eee06559827d86d4dc 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 55/60] 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 b11d8af311e386d234d519a69a94472722ccad24 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 56/60] 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 8c2809d4e28032b1a4f49e15ec53de66642282ee 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 57/60] 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 bf8f7527d2c76827b1693f0e4005f021a0989c97 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 58/60] s3:tldap: We should not stop in the middle of parsing

Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Simo Sorce <idra 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 13ec664f6adaa9f090f41c3517a9852756334b4c 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/60] 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


>From 4d9fcc1495da5335d2910f76bd3ca079681af4fd Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 21 Dec 2017 17:24:01 +0100
Subject: [PATCH 60/60] s3:selftest: Run the smbtorture3 TLDAP test

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 source3/selftest/tests.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 54969f8cc81..94dc2a67481 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -92,6 +92,9 @@ for t in tests:
         plantestsuite("samba3.smbtorture_s3.crypt_server(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmpenc', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
     plantestsuite("samba3.smbtorture_s3.plain(ad_dc_ntvfs).%s" % t, "ad_dc_ntvfs", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
 
+t = "TLDAP"
+plantestsuite("samba3.smbtorture_s3.plain.%s(ad_dc)" % t, "ad_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER/tmp', '$DC_USERNAME', '$DC_PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
+
 #
 # RENAME-ACCESS needs to run against a special share - acl_xattr_ign_sysacl_windows
 #
-- 
2.15.1



More information about the samba-technical mailing list