From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 28 10:22:06 2016 Received: (at submit) by debbugs.gnu.org; 28 Nov 2016 15:22:06 +0000 Received: from localhost ([127.0.0.1]:45048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBNks-0003R4-0d for submit@debbugs.gnu.org; Mon, 28 Nov 2016 10:22:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBNkp-0003Qa-7T for submit@debbugs.gnu.org; Mon, 28 Nov 2016 10:22:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBNke-0002xA-VB for submit@debbugs.gnu.org; Mon, 28 Nov 2016 10:21:57 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBNke-0002x6-Rt for submit@debbugs.gnu.org; Mon, 28 Nov 2016 10:21:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBNkd-0004ue-L8 for bug-coreutils@gnu.org; Mon, 28 Nov 2016 10:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBNkY-0002v0-06 for bug-coreutils@gnu.org; Mon, 28 Nov 2016 10:21:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56978) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBNkX-0002uc-QJ for bug-coreutils@gnu.org; Mon, 28 Nov 2016 10:21:45 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29B823F1F7 for ; Mon, 28 Nov 2016 15:21:44 +0000 (UTC) Received: from f24.localdomain (unused-4-224.brq.redhat.com [10.34.4.224]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uASFLgvo029420; Mon, 28 Nov 2016 10:21:43 -0500 From: Kamil Dudka To: bug-coreutils@gnu.org Subject: [PATCH] install,mkdir: fix handling of -DZ and -pZ, respectively Date: Mon, 28 Nov 2016 16:21:42 +0100 Message-Id: <1480346502-6723-1-git-send-email-kdudka@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 28 Nov 2016 15:21:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) ... in case two or more directories nested in each other are created and each of them defaults to a different SELinux context. * src/install.c (make_ancestor): When calling defaultcon(), give it the same path that is given to mkdir(). The other path is not always valid wrt. current working directory. * src/mkdir.c (make_ancestor): Likewise. * NEWS: Mention the bug fix. Reported at https://bugzilla.redhat.com/1398913 --- NEWS | 4 ++++ src/install.c | 2 +- src/mkdir.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 6f7505f..e88e932 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,10 @@ GNU coreutils NEWS -*- outline -*- factor again outputs immediately when numbers are input interactively. [bug introduced in coreutils-8.24] + install -DZ and mkdir -pZ now set default SELinux context correctly even if + two or more directories nested in each other are created and each of them + defaults to a different SELinux context. + ls --time-style no longer mishandles '%%b' in formats. [bug introduced in coreutils-7.2] diff --git a/src/install.c b/src/install.c index 414d645..d79d597 100644 --- a/src/install.c +++ b/src/install.c @@ -427,7 +427,7 @@ static int make_ancestor (char const *dir, char const *component, void *options) { struct cp_options const *x = options; - if (x->set_security_context && defaultcon (dir, S_IFDIR) < 0 + if (x->set_security_context && defaultcon (component, S_IFDIR) < 0 && ! ignorable_ctx_err (errno)) error (0, errno, _("failed to set default creation context for %s"), quoteaf (dir)); diff --git a/src/mkdir.c b/src/mkdir.c index ccd923b..6b51292 100644 --- a/src/mkdir.c +++ b/src/mkdir.c @@ -123,7 +123,7 @@ make_ancestor (char const *dir, char const *component, void *options) { struct mkdir_options const *o = options; - if (o->set_security_context && defaultcon (dir, S_IFDIR) < 0 + if (o->set_security_context && defaultcon (component, S_IFDIR) < 0 && ! ignorable_ctx_err (errno)) error (0, errno, _("failed to set default creation context for %s"), quoteaf (dir)); -- 2.7.4 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 28 11:11:45 2016 Received: (at 25052-done) by debbugs.gnu.org; 28 Nov 2016 16:11:45 +0000 Received: from localhost ([127.0.0.1]:45100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBOWv-0004ew-5A for submit@debbugs.gnu.org; Mon, 28 Nov 2016 11:11:45 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:47128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBOWt-0004en-60 for 25052-done@debbugs.gnu.org; Mon, 28 Nov 2016 11:11:43 -0500 Received: from [192.168.1.80] (unknown [109.76.227.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 9E6B2153; Mon, 28 Nov 2016 16:11:39 +0000 (GMT) Subject: Re: bug#25052: [PATCH] install, mkdir: fix handling of -DZ and -pZ, respectively To: Kamil Dudka , 25052-done@debbugs.gnu.org References: <1480346502-6723-1-git-send-email-kdudka@redhat.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Mon, 28 Nov 2016 16:11:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1480346502-6723-1-git-send-email-kdudka@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25052-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 28/11/16 15:21, Kamil Dudka wrote: > ... in case two or more directories nested in each other are created and > each of them defaults to a different SELinux context. > > * src/install.c (make_ancestor): When calling defaultcon(), give it the > same path that is given to mkdir(). The other path is not always valid > wrt. current working directory. > * src/mkdir.c (make_ancestor): Likewise. > * NEWS: Mention the bug fix. > > Reported at https://bugzilla.redhat.com/1398913 > --- > NEWS | 4 ++++ > src/install.c | 2 +- > src/mkdir.c | 2 +- > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/NEWS b/NEWS > index 6f7505f..e88e932 100644 > --- a/NEWS > +++ b/NEWS > @@ -25,6 +25,10 @@ GNU coreutils NEWS -*- outline -*- > factor again outputs immediately when numbers are input interactively. > [bug introduced in coreutils-8.24] > > + install -DZ and mkdir -pZ now set default SELinux context correctly even if > + two or more directories nested in each other are created and each of them > + defaults to a different SELinux context. > + > ls --time-style no longer mishandles '%%b' in formats. > [bug introduced in coreutils-7.2] > > diff --git a/src/install.c b/src/install.c > index 414d645..d79d597 100644 > --- a/src/install.c > +++ b/src/install.c > @@ -427,7 +427,7 @@ static int > make_ancestor (char const *dir, char const *component, void *options) > { > struct cp_options const *x = options; > - if (x->set_security_context && defaultcon (dir, S_IFDIR) < 0 > + if (x->set_security_context && defaultcon (component, S_IFDIR) < 0 > && ! ignorable_ctx_err (errno)) > error (0, errno, _("failed to set default creation context for %s"), > quoteaf (dir)); > diff --git a/src/mkdir.c b/src/mkdir.c > index ccd923b..6b51292 100644 > --- a/src/mkdir.c > +++ b/src/mkdir.c > @@ -123,7 +123,7 @@ make_ancestor (char const *dir, char const *component, void *options) > { > struct mkdir_options const *o = options; > > - if (o->set_security_context && defaultcon (dir, S_IFDIR) < 0 > + if (o->set_security_context && defaultcon (component, S_IFDIR) < 0 > && ! ignorable_ctx_err (errno)) > error (0, errno, _("failed to set default creation context for %s"), > quoteaf (dir)); > Looks good. Good timing re release 8.26 which we're about to cut. thanks! Pádraig From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 28 11:39:46 2016 Received: (at 25052-done) by debbugs.gnu.org; 28 Nov 2016 16:39:46 +0000 Received: from localhost ([127.0.0.1]:45138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBOy2-0005M8-6w for submit@debbugs.gnu.org; Mon, 28 Nov 2016 11:39:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBOxz-0005Lw-Tt for 25052-done@debbugs.gnu.org; Mon, 28 Nov 2016 11:39:44 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73A6681235; Mon, 28 Nov 2016 16:39:38 +0000 (UTC) Received: from kdudka-nb.localnet (unused-4-224.brq.redhat.com [10.34.4.224]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uASGdbCE019522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Nov 2016 11:39:38 -0500 From: Kamil Dudka To: =?ISO-8859-1?Q?P=E1draig?= Brady Subject: Re: bug#25052: [PATCH] install, mkdir: fix handling of -DZ and -pZ, respectively Date: Mon, 28 Nov 2016 17:39:38 +0100 Message-ID: <4504791.u5DjOFGJE0@kdudka-nb> User-Agent: KMail/4.14.10 (Linux/4.8.6-gentoo; KDE/4.14.24; x86_64; ; ) In-Reply-To: References: <1480346502-6723-1-git-send-email-kdudka@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 28 Nov 2016 16:39:38 +0000 (UTC) X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 25052-done Cc: 25052-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) On Monday, November 28, 2016 16:11:34 P=E1draig Brady wrote: > On 28/11/16 15:21, Kamil Dudka wrote: > > ... in case two or more directories nested in each other are create= d and > > each of them defaults to a different SELinux context. > >=20 > > * src/install.c (make_ancestor): When calling defaultcon(), give it= the > > same path that is given to mkdir(). The other path is not always v= alid > > wrt. current working directory. > > * src/mkdir.c (make_ancestor): Likewise. > > * NEWS: Mention the bug fix. > >=20 > > Reported at https://bugzilla.redhat.com/1398913 > > --- > >=20 > > NEWS | 4 ++++ > > src/install.c | 2 +- > > src/mkdir.c | 2 +- > > 3 files changed, 6 insertions(+), 2 deletions(-) > >=20 > > diff --git a/NEWS b/NEWS > > index 6f7505f..e88e932 100644 > > --- a/NEWS > > +++ b/NEWS > > @@ -25,6 +25,10 @@ GNU coreutils NEWS = =20 > > -*- outline -*->=20 > > factor again outputs immediately when numbers are input interact= ively. > > [bug introduced in coreutils-8.24] > >=20 > > + install -DZ and mkdir -pZ now set default SELinux context correc= tly > > even if + two or more directories nested in each other are created= and > > each of them + defaults to a different SELinux context. > > + > >=20 > > ls --time-style no longer mishandles '%%b' in formats. > > [bug introduced in coreutils-7.2] > >=20 > > diff --git a/src/install.c b/src/install.c > > index 414d645..d79d597 100644 > > --- a/src/install.c > > +++ b/src/install.c > > @@ -427,7 +427,7 @@ static int > >=20 > > make_ancestor (char const *dir, char const *component, void *optio= ns) > > { > > =20 > > struct cp_options const *x =3D options; > >=20 > > - if (x->set_security_context && defaultcon (dir, S_IFDIR) < 0 > > + if (x->set_security_context && defaultcon (component, S_IFDIR) <= 0 > >=20 > > && ! ignorable_ctx_err (errno)) > > =20 > > error (0, errno, _("failed to set default creation context for= %s"), > > =20 > > quoteaf (dir)); > >=20 > > diff --git a/src/mkdir.c b/src/mkdir.c > > index ccd923b..6b51292 100644 > > --- a/src/mkdir.c > > +++ b/src/mkdir.c > > @@ -123,7 +123,7 @@ make_ancestor (char const *dir, char const *com= ponent, > > void *options)>=20 > > { > > =20 > > struct mkdir_options const *o =3D options; > >=20 > > - if (o->set_security_context && defaultcon (dir, S_IFDIR) < 0 > > + if (o->set_security_context && defaultcon (component, S_IFDIR) <= 0 > >=20 > > && ! ignorable_ctx_err (errno)) > > =20 > > error (0, errno, _("failed to set default creation context for= %s"), > > =20 > > quoteaf (dir)); >=20 > Looks good. > Good timing re release 8.26 which we're about to cut. Thanks for merging it upstream! Looking forward for the new release...= Kamil > thanks! > P=E1draig From unknown Sat Aug 16 16:15:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 27 Dec 2016 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator