Received: by mail.netbsd.org (Postfix, from userid 605) id 0680384D72; Thu, 19 Sep 2019 23:53:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 7D56984D26 for ; Thu, 19 Sep 2019 23:53:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id wKh0eU90IqtO for ; Thu, 19 Sep 2019 23:53:36 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id AB1C984CF1 for ; Thu, 19 Sep 2019 23:53:36 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 9DCD3FBF4; Thu, 19 Sep 2019 23:53:36 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1568937216235080" MIME-Version: 1.0 Date: Thu, 19 Sep 2019 23:53:36 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/regress To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20190919235336.9DCD3FBF4@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1568937216235080 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Thu Sep 19 23:53:36 UTC 2019 Modified Files: pkgsrc/regress: Makefile Added Files: pkgsrc/regress/check-perms: DESCR Makefile PLIST spec Log Message: regress/check-perms: add test for broken CHECK_PERMS_AUTOFIX The variable CHECK_PERMS_AUTOFIX has been existing since 2006 but is not used in any package. This may be because it is not helpful in any way. When a package sets this variables to yes, the permission errors are not silently fixed, but the build still fails instead. This behavior is not useful in any way and thus needs to be fixed. See https://mail-index.netbsd.org/tech-pkg/2019/08/thread1.html#021828 To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 pkgsrc/regress/Makefile cvs rdiff -u -r0 -r1.1 pkgsrc/regress/check-perms/DESCR \ pkgsrc/regress/check-perms/Makefile pkgsrc/regress/check-perms/PLIST \ pkgsrc/regress/check-perms/spec Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1568937216235080 Content-Disposition: inline Content-Length: 3905 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/regress/Makefile diff -u pkgsrc/regress/Makefile:1.24 pkgsrc/regress/Makefile:1.25 --- pkgsrc/regress/Makefile:1.24 Wed Jul 17 18:34:16 2019 +++ pkgsrc/regress/Makefile Thu Sep 19 23:53:36 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.24 2019/07/17 18:34:16 rillig Exp $ +# $NetBSD: Makefile,v 1.25 2019/09/19 23:53:36 rillig Exp $ # # See https://www.netbsd.org/docs/pkgsrc/regression.html for more # information about these tests. @@ -11,6 +11,7 @@ SUBDIR+= bootstrap-install-sh SUBDIR+= buildlink-libtool SUBDIR+= buildlink-transform SUBDIR+= buildlink-unwrap +SUBDIR+= check-perms SUBDIR+= check-portability SUBDIR+= compiler SUBDIR+= env-vars Added files: Index: pkgsrc/regress/check-perms/DESCR diff -u /dev/null pkgsrc/regress/check-perms/DESCR:1.1 --- /dev/null Thu Sep 19 23:53:36 2019 +++ pkgsrc/regress/check-perms/DESCR Thu Sep 19 23:53:36 2019 @@ -0,0 +1 @@ +Regression test for mk/check/check-perms.mk. Index: pkgsrc/regress/check-perms/Makefile diff -u /dev/null pkgsrc/regress/check-perms/Makefile:1.1 --- /dev/null Thu Sep 19 23:53:36 2019 +++ pkgsrc/regress/check-perms/Makefile Thu Sep 19 23:53:36 2019 @@ -0,0 +1,25 @@ +# $NetBSD: Makefile,v 1.1 2019/09/19 23:53:36 rillig Exp $ + +DISTNAME= check-perms-1.0 +CATEGORIES= regress +MASTER_SITES= # none +DISTFILES= # none + +MAINTAINER= pkgsrc-users@NetBSD.org +COMMENT= Ensures that wrong file permissions are fixed +LICENSE= 2-clause-bsd + +NO_CHECKSUM= yes +WRKSRC= ${WRKDIR} +BUILD_DIRS= # none +AUTO_MKDIRS= yes + +USE_TOOLS+= pax + +do-extract: + cd ${WRKSRC} && > demo-file && chmod 777 demo-file + +do-install: + cd ${WRKSRC} && pax -wr -pp demo-file ${DESTDIR}${PREFIX}/share/regress-check-perms/ + +.include "../../mk/bsd.pkg.mk" Index: pkgsrc/regress/check-perms/PLIST diff -u /dev/null pkgsrc/regress/check-perms/PLIST:1.1 --- /dev/null Thu Sep 19 23:53:36 2019 +++ pkgsrc/regress/check-perms/PLIST Thu Sep 19 23:53:36 2019 @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST,v 1.1 2019/09/19 23:53:36 rillig Exp $ +share/regress-check-perms/demo-file Index: pkgsrc/regress/check-perms/spec diff -u /dev/null pkgsrc/regress/check-perms/spec:1.1 --- /dev/null Thu Sep 19 23:53:36 2019 +++ pkgsrc/regress/check-perms/spec Thu Sep 19 23:53:36 2019 @@ -0,0 +1,58 @@ +#! /bin/sh +# $NetBSD: spec,v 1.1 2019/09/19 23:53:36 rillig Exp $ +set -eu + +do_cleanup() { + $TEST_MAKE deinstall clean +} + +do_make() { + echo "Running test case $*" + + #$TEST_MAKE "$@" show-all-check-perms + + $TEST_MAKE "$@" deinstall clean install 1>"$TEST_OUTFILE" 2>&1 \ + && TEST_EXITSTATUS=0 || TEST_EXITSTATUS=$? +} + +test_no_developer_no_autofix() { + do_make PKG_DEVELOPER=no CHECK_PERMS_AUTOFIX=no + + exit_status 0 +} + +test_no_developer_autofix() { + do_make PKG_DEVELOPER=no CHECK_PERMS_AUTOFIX=yes + + # FIXME: The permissions must be fixed even though PKG_DEVELOPER=no. + exit_status 0 + output_prohibit "^error: .*: world-writable file" +} + +test_developer_no_autofix() { + do_make PKG_DEVELOPER=yes CHECK_PERMS_AUTOFIX=no + + exit_status 1 + output_require "^warning: .*/demo-file: too small to be a valid executable file" + output_require "^warning: .*/demo-file: group-writable file" + output_require "^error: .*/demo-file: world-writable file" +} + +test_developer_autofix() { + do_make PKG_DEVELOPER=yes CHECK_PERMS_AUTOFIX=yes + + # FIXME: Since all permission problems have been fixed, the exit status must be 0. + # This needs to be fixed in checkperms upstream. + exit_status 1 + output_require "^warning: .*/demo-file: too small to be a valid executable file" + output_require "^warning: .*/demo-file: group-writable file" + output_require "^error: .*/demo-file: world-writable file" + output_require "^note: .*/demo-file: fixed permissions from 0777 to 0644" +} + +do_test() { + test_no_developer_no_autofix + test_no_developer_autofix + test_developer_no_autofix + test_developer_autofix +} --_----------=_1568937216235080--