From patchwork Tue Dec 11 11:21:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1011037 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.com.br Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Dcw01gZjz9s3Z for ; Tue, 11 Dec 2018 22:21:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C182586460; Tue, 11 Dec 2018 11:21:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bqHHQBWleTG0; Tue, 11 Dec 2018 11:21:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id BAA6B863D9; Tue, 11 Dec 2018 11:21:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 58FF21BF20F for ; Tue, 11 Dec 2018 11:21:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5665B877E9 for ; Tue, 11 Dec 2018 11:21:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p5ZzIG0yzJnU for ; Tue, 11 Dec 2018 11:21:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.com.br (mx.datacom.ind.br [177.66.5.10]) by hemlock.osuosl.org (Postfix) with ESMTPS id 313E7877FF for ; Tue, 11 Dec 2018 11:21:23 +0000 (UTC) Received: from mail.datacom.com.br (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTPS id 918511BA2FA7 for ; Tue, 11 Dec 2018 09:21:29 -0200 (-02) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTP id 828021BA2F78 for ; Tue, 11 Dec 2018 09:21:29 -0200 (-02) Received: from mail.datacom.com.br ([127.0.0.1]) by localhost (mail.datacom.com.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id a7FB_qmUxzwk for ; Tue, 11 Dec 2018 09:21:29 -0200 (-02) Received: from pedeld202344.datacom.net (pedeld202344.datacom.net [10.0.120.87]) by mail.datacom.com.br (Postfix) with ESMTPSA id 5706A1BA2E81 for ; Tue, 11 Dec 2018 09:21:29 -0200 (-02) From: Carlos Santos To: buildroot@buildroot.org Date: Tue, 11 Dec 2018 09:21:13 -0200 Message-Id: <20181211112113.21648-1-casantos@datacom.com.br> X-Mailer: git-send-email 2.14.5 Subject: [Buildroot] [PATCH] package/libpam-tacplus: fix compilation with GCC 8 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" GCC 8 demands that the size of the string copied by strncpy be smaller than the size of the destination to keep space for the trailibg '\0'. This causes a compilation error in pam_tacplus, so add a patch already sent uptream to fix it. Fixes: http://autobuild.buildroot.net/results/da6d150e470046c03c5f7463de045604e15e4a30/ Signed-off-by: Carlos Santos --- ...0002-Fix-compilation-of-tacc.c-with-GCC-8.patch | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 package/libpam-tacplus/0002-Fix-compilation-of-tacc.c-with-GCC-8.patch diff --git a/package/libpam-tacplus/0002-Fix-compilation-of-tacc.c-with-GCC-8.patch b/package/libpam-tacplus/0002-Fix-compilation-of-tacc.c-with-GCC-8.patch new file mode 100644 index 0000000000..2f87b92767 --- /dev/null +++ b/package/libpam-tacplus/0002-Fix-compilation-of-tacc.c-with-GCC-8.patch @@ -0,0 +1,39 @@ +From 4c9635b03d0acf140f65004be9d4822297ee5a35 Mon Sep 17 00:00:00 2001 +From: Carlos Santos +Date: Mon, 10 Dec 2018 17:27:16 -0200 +Subject: [PATCH] Fix compilation of tacc.c with GCC 8 + +GCC 8 demands that the size of the string copied by strncpy be smaller +than the size of the destination to keep space for the trailibg '\0': + +tacc.c:378:3: error: 'strncpy' specified bound 4 equals destination size [-Werror=stringop-truncation] + strncpy(utmpx.ut_id, tty + C_STRLEN("tty"), sizeof(utmpx.ut_id)); + +Ensure that no more than sizeof(utmpx.ut_id) - 1 characters are copied +and that a trailing '\0' is stored. + +Fixes: + http://autobuild.buildroot.net/results/da6d150e470046c03c5f7463de045604e15e4a30/ + +Signed-off-by: Carlos Santos +--- + tacc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tacc.c b/tacc.c +index f61e2d7..3c1a40c 100644 +--- a/tacc.c ++++ b/tacc.c +@@ -375,7 +375,8 @@ int main(int argc, char **argv) { + utmpx.ut_type = USER_PROCESS; + utmpx.ut_pid = getpid(); + xstrcpy(utmpx.ut_line, tty, sizeof(utmpx.ut_line)); +- strncpy(utmpx.ut_id, tty + C_STRLEN("tty"), sizeof(utmpx.ut_id)); ++ strncpy(utmpx.ut_id, tty + C_STRLEN("tty"), sizeof(utmpx.ut_id) - 1); ++ utmpx.ut_id[sizeof(utmpx.ut_id) - 1] = '\0'; + xstrcpy(utmpx.ut_host, "dialup", sizeof(utmpx.ut_host)); + utmpx.ut_tv.tv_sec = tv.tv_sec; + utmpx.ut_tv.tv_usec = tv.tv_usec; +-- +2.14.5 +