From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 12:42:54 2013 Received: (at submit) by debbugs.gnu.org; 23 Apr 2013 16:42:54 +0000 Received: from localhost ([127.0.0.1]:39268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUgIt-0004ey-Kv for submit@debbugs.gnu.org; Tue, 23 Apr 2013 12:42:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42936) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUdGH-0002NZ-Br for submit@debbugs.gnu.org; Tue, 23 Apr 2013 09:27:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUdBQ-00087y-0a for submit@debbugs.gnu.org; Tue, 23 Apr 2013 09:23:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:52032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUdBP-00087q-TF for submit@debbugs.gnu.org; Tue, 23 Apr 2013 09:22:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUdBL-0006JP-Hx for bug-coreutils@gnu.org; Tue, 23 Apr 2013 09:22:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUdBH-00086P-06 for bug-coreutils@gnu.org; Tue, 23 Apr 2013 09:22:51 -0400 Received: from mail-ia0-x22c.google.com ([2607:f8b0:4001:c02::22c]:44156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUdBG-00086I-SF for bug-coreutils@gnu.org; Tue, 23 Apr 2013 09:22:46 -0400 Received: by mail-ia0-f172.google.com with SMTP id i20so533574ian.3 for ; Tue, 23 Apr 2013 06:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=Fqzrx0KhgYOkFs3D7mneq6WMHGDz99yV1r2uv+dFEvI=; b=Eda5/oy8DT8VBfsLk7jAnV7985OzieXD9Clb/rR896eM1yC5K2b2h7ym4qBCSERcqx YBeyYbT8xedb9RlaZVAGh9oYiAwI9om6MztDqReOfMa0BqKAKkpJ3pdUaQ1fJzLA01Qx LfSENqTbukvv7RLwGBxHiCjDAV5m7nlF/4QuQU5dxqo5XSAbxWVyadsGwCPuZNpAli08 24bKy457jyXWJzVX9J5WKteU3cf3y/fMqtXDvHkQKQmKm2YwRX+nTPoJOo0k8IJPsCqP PjQrHkee/o00Xs6cUj2OjBJ05w0Y7/FZwgmp0Vybu2YIApL5Irjtyq3Mjl2keErZ44m9 SyWg== MIME-Version: 1.0 X-Received: by 10.50.93.3 with SMTP id cq3mr10943763igb.70.1366723365997; Tue, 23 Apr 2013 06:22:45 -0700 (PDT) Received: by 10.231.184.6 with HTTP; Tue, 23 Apr 2013 06:22:45 -0700 (PDT) Date: Tue, 23 Apr 2013 14:22:45 +0100 X-Google-Sender-Auth: 8LFTDPTBFH9Ky1OGLXDvz90Yr-M Message-ID: Subject: mkdir --parents --mode XXX incorrect mode for parents From: Richard Russon To: bug-coreutils@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 23 Apr 2013 12:42:49 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: rich@flatcap.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Description of problem: mkdir doesn't honour the mode option when the parents option is used. The leaf directories have their permissions set correctly, but the parent directory has the permissions according to your umask. How reproducible: Always Steps to Reproduce: 1. umask 077 2. mkdir --parents --mode 755 project/subproject 3. ls -ld project project/subproject Actual results: drwx------. 3 flatcap flatcap 60 Apr 23 14:17 project drwxr-xr-x. 2 flatcap flatcap 40 Apr 23 14:17 project/subproject Expected results: drwxr-xr-x. 3 flatcap flatcap 60 Apr 23 14:17 project drwxr-xr-x. 2 flatcap flatcap 40 Apr 23 14:17 project/subproject Additional info: mkdir (GNU coreutils) 8.17 fedora 18 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 13:48:07 2013 Received: (at control) by debbugs.gnu.org; 23 Apr 2013 17:48:08 +0000 Received: from localhost ([127.0.0.1]:39367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUhK3-00076x-9z for submit@debbugs.gnu.org; Tue, 23 Apr 2013 13:48:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23720) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUhJz-00076b-G6; Tue, 23 Apr 2013 13:48:05 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3NHh3qM010374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Apr 2013 13:43:04 -0400 Received: from [10.3.113.109] (ovpn-113-109.phx2.redhat.com [10.3.113.109]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3NHh3tA024256; Tue, 23 Apr 2013 13:43:03 -0400 Message-ID: <5176C826.9010001@redhat.com> Date: Tue, 23 Apr 2013 11:43:02 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 To: rich@flatcap.org Subject: Re: bug#14249: mkdir --parents --mode XXX incorrect mode for parents References: In-Reply-To: X-Enigmail-Version: 1.5.1 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2DAWSVULMBBKOBOTCJWEJ" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control Cc: 14249-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DAWSVULMBBKOBOTCJWEJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 14249 notabug thanks On 04/23/2013 07:22 AM, Richard Russon wrote: > Description of problem: > mkdir doesn't honour the mode option when the parents option is used. > The leaf directories have their permissions set correctly, but the > parent directory has the permissions according to your umask. Thanks for the report. However, this is the behavior required by POSIX, so it is correct: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/mkdir.html =2E.. the mkdir utility shall create any pathname components of the path prefix of dir that do not name an existing directory by performing actions equivalent to first calling the mkdir() function with the following arguments: A pathname naming the missing pathname component, ending with a trailing character, as the path argument The value zero as the mode argument and then calling the chmod() function with the following arguments: The same path argument as in the mkdir() call The value (S_IWUSR|S_IXUSR| =CC=83filemask)&0777[1] as the mode argum= ent, where filemask is the file mode creation mask of the process (see XSH umask). =2E..For intermediate pathname components created by mkdir, the mode is the default modified by u+ wx so that the subdirectories can always be created regardless of the file mode creation mask; if different ultimate permissions are desired for the intermediate directories, they can be changed afterwards with chmod. [1]Shoot - there's a bug in the html rendition of the POSIX 2013 document, just released this month. The pdf version has the correct text; I'll chase down getting the omitted portion of the html version fix= ed. > Steps to Reproduce: > 1. umask 077 > 2. mkdir --parents --mode 755 project/subproject > 3. ls -ld project project/subproject >=20 > Actual results: > drwx------. 3 flatcap flatcap 60 Apr 23 14:17 project > drwxr-xr-x. 2 flatcap flatcap 40 Apr 23 14:17 project/subproject This behavior is what POSIX mandates. >=20 > Expected results: > drwxr-xr-x. 3 flatcap flatcap 60 Apr 23 14:17 project > drwxr-xr-x. 2 flatcap flatcap 40 Apr 23 14:17 project/subproject If you want that, then you have to either (temporarily) clear your umask, or call multiple mkdir invocations yourself, instead of letting -p do it for you. I'm closing out this bug report, although you may continue to comment if you have further questions. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2DAWSVULMBBKOBOTCJWEJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRdsgmAAoJEKeha0olJ0Nq6owH/Ri2bcX7SftsMt92xvGvcuFQ YfppYVQZnN4/3WXt5IFfJna0CVGRUplKwelHhUYGWvlhmee4oTEMmvyTFBGfntZy nSwn2IRnfXzzcqC+d5MgfLSfVG8KfT+Dtu2T+GEnI8xOHiAFR/40fgJVpp5yTvus zQLCrdPbEDkNjmSsbQMLdLuCHHX1Yp4xGwLm77YL+0zIs20IhZwOdaiLTjR8TDX7 qv+kA4Y/yYovO9ZiU23pUU1Vcgs7dWaVSWroCrYBBviVYXy6e3wc2WukbVkYTXLq tKbV/c0qXNwpe811Vn4uL3o95SfTcHdRno9W8AYeICP+87WDlT5MO2+9TGCCAkg= =HEbT -----END PGP SIGNATURE----- ------enig2DAWSVULMBBKOBOTCJWEJ-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 13:53:06 2013 Received: (at 14249) by debbugs.gnu.org; 23 Apr 2013 17:53:06 +0000 Received: from localhost ([127.0.0.1]:39382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUhOs-0007Hp-7l for submit@debbugs.gnu.org; Tue, 23 Apr 2013 13:53:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32319) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUhOp-0007Hg-UN for 14249@debbugs.gnu.org; Tue, 23 Apr 2013 13:53:04 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3NHm54W012892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Apr 2013 13:48:05 -0400 Received: from [10.3.113.109] (ovpn-113-109.phx2.redhat.com [10.3.113.109]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3NHm4lU007567; Tue, 23 Apr 2013 13:48:05 -0400 Message-ID: <5176C954.1020108@redhat.com> Date: Tue, 23 Apr 2013 11:48:04 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 To: 14249@debbugs.gnu.org, rich@flatcap.org Subject: Re: bug#14249: mkdir --parents --mode XXX incorrect mode for parents References: <5176C826.9010001@redhat.com> In-Reply-To: <5176C826.9010001@redhat.com> X-Enigmail-Version: 1.5.1 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2DWJVJGISSATMKKPRBPNF" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 14249 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DWJVJGISSATMKKPRBPNF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/23/2013 11:43 AM, Eric Blake wrote: > The value (S_IWUSR|S_IXUSR| =CC=83filemask)&0777[1] as the mode arg= ument, > where filemask is the file mode creation mask of the process (see XSH > umask). >=20 > [1]Shoot - there's a bug in the html rendition of the POSIX 2013 > document, just released this month. The pdf version has the correct > text; I'll chase down getting the omitted portion of the html version f= ixed. http://austingroupbugs.net/view.php?id=3D682 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2DWJVJGISSATMKKPRBPNF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRdslUAAoJEKeha0olJ0NqLAwH/2YUCTb1HDEyiKr3uzPn+0xZ gftMoe8KZD7M87Lr6E3ylVGrq5EeoUsHlu/Nsu3+ZEmw+ENyVfAkvwzz9bZno1XD 2Ftw2tKdj7tHFRJVaL93av39vI47pNeyNywr8LpBpDgbEPlqqKGOp5ur1X5ajOiC 42NeXnhg65xb+xxC/Vl3llls0zOX9rJAKt9t/L/R+DDe2V4FjnwC/T6f0ikvJP8K xR3atfT7pI/UCFANr30RpD29/klqMdTQitgqYvputMtGBDxg95qOjcfxDlC1ydUM lNEofFYMPk3XUYbW4tsI6Fnh6B6VBLCnX0DP0B+lqpoHnKFqvPQLZpzbTyvnX5M= =vaQ8 -----END PGP SIGNATURE----- ------enig2DWJVJGISSATMKKPRBPNF-- From unknown Wed Jun 18 00:27:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 22 May 2013 11:24:02 +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