From patchwork Tue Feb 12 23:05:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 31432 Received: (qmail 115359 invoked by alias); 12 Feb 2019 23:05:12 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 115350 invoked by uid 89); 12 Feb 2019 23:05:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Tue, 12 Feb 2019 23:05:05 +0000 From: Joseph Myers To: Subject: Avoid fall-through in test-container if execlp fails Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 One of the implicit-fallthrough warnings from compiling glibc with -Wextra appears to indicate an actual bug: the test-container code could fall through inappropriately if execlp returns (which only occurs on error). This patch adds appropriate error handling in this case to avoid that fall-through. Tested for x86_64. 2019-02-12 Joseph Myers * support/test-container.c (recursive_remove): Use FAIL_EXIT1 if execlp returns. diff --git a/support/test-container.c b/support/test-container.c index a24b24c03b..ed911e33f9 100644 --- a/support/test-container.c +++ b/support/test-container.c @@ -361,6 +361,7 @@ recursive_remove (char *path) case 0: /* Child. */ execlp ("rm", "rm", "-rf", path, NULL); + FAIL_EXIT1 ("exec rm: %m"); default: /* Parent. */ waitpid (child, &status, 0);