From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Rv41J-0008Hw-Qh for ptxdist@pengutronix.de; Wed, 08 Feb 2012 10:40:57 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1Rv41J-0003Te-Pk for ptxdist@pengutronix.de; Wed, 08 Feb 2012 10:40:57 +0100 Date: Wed, 8 Feb 2012 10:40:57 +0100 From: Michael Olbrich Message-ID: <20120208094057.GN32645@pengutronix.de> References: <1328654437-18702-1-git-send-email-andreas@biessmann.de> <20120208070503.GM32645@pengutronix.de> <4F3226F4.2020906@biessmann.de> <4F322AAE.6090800@biessmann.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4F322AAE.6090800@biessmann.de> Subject: Re: [ptxdist] [PATCH] configure: add GNU mkdir check Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Wed, Feb 08, 2012 at 08:56:30AM +0100, Andreas Bie=DFmann wrote: > Hi again ... > = > On 08.02.12 08:40, Andreas Bie=DFmann wrote: > > Hi Michael, > > = > > On 08.02.12 08:05, Michael Olbrich wrote: > >> On Tue, Feb 07, 2012 at 11:40:37PM +0100, Andreas Bie=DFmann wrote: > >>> Signed-off-by: Andreas Bie=DFmann > >> > >> Does this mean the uname patch is not needed? I don't mind applying th= is > >> patch either way, but I'd like know if the original problem still exis= ts. > > = > > I could really not reproduce the 'umask' problem at home (OS X; GNU > > coreutils mkdir 8.12) but will retry at work where the problem came up. > > Will send more info today. > = > sorry but _I can reproduce it_ on OS X (I forgot to set umask of 0077): > = > ---8<--- > andreas-mbp:OSELAS.Toolchain andreas$ ../ptxdist/bin/ptxdist go > = > error: > '/opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/gcc-4.6.2-glibc-2= .14.1-binutils-2.21.1a-kernel-2.6.39-sanitized' > does not exist and cannot be created! > Please create that dir with write permissions for you. > = > press enter to let sudo do that job! > = > sudo mkdir -p > /opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/gcc-4.6.2-glibc-2.= 14.1-binutils-2.21.1a-kernel-2.6.39-sanitized > sudo chown 502 > /opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/gcc-4.6.2-glibc-2.= 14.1-binutils-2.21.1a-kernel-2.6.39-sanitized > = > error: > '/opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/gcc-4.6.2-glibc-2= .14.1-binutils-2.21.1a-kernel-2.6.39-sanitized' > does exist, but is not writable. > Change the permissions and try again. > = > press enter to let sudo do the job! > = > sudo chown 502 > /opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/gcc-4.6.2-glibc-2.= 14.1-binutils-2.21.1a-kernel-2.6.39-sanitized > sudo chmod u+w > /opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/gcc-4.6.2-glibc-2.= 14.1-binutils-2.21.1a-kernel-2.6.39-sanitized > = > error: cannot make > '/opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/gcc-4.6.2-glibc-2= .14.1-binutils-2.21.1a-kernel-2.6.39-sanitized' > writable, giving up > = > andreas-mbp:OSELAS.Toolchain andreas$ umask > 0077 > --->8--- > = > So the problem is this way: > = > - umask is 0077 > - check_dirs_mkdir() will test to mkdir -m755 -p > /opt/OSELAS.../.../gcc-... -> fails > - check_dirs_mkdir() provide sudo mkdir ... (note! without -m755) > -> success BUT: > = > ---8<--- > andreas-mbp:OSELAS.Toolchain andreas$ ls -la > /opt/OSELAS.Toolchain-2011.11.0/ > total 0 > drwxr-xr-x 8 root wheel 272 8 Feb 08:48 . > drwxr-xr-x@ 4 root wheel 136 20 Dez 23:58 .. > drwxr-xr-x 3 root wheel 102 19 Jan 10:02 arm-cortexa8-linux-gnueabi > drwxr-xr-x 3 root wheel 102 9 Jan 08:22 arm-v4t-linux-gnueabi > drwxr-xr-x 3 root wheel 102 18 Jan 18:33 arm-v5te-linux-gnueabi > drwxr-xr-x 3 root wheel 102 11 Jan 00:32 avr > drwx------ 3 root wheel 102 8 Feb 08:48 i586-unknown-linux-gnu > drwxr-xr-x 3 root wheel 102 7 Feb 23:46 x86_64-unknown-linux-gnu > andreas-mbp:OSELAS.Toolchain andreas$ ls -la > /opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/ > ls: : Permission denied > andreas-mbp:OSELAS.Toolchain andreas$ sudo ls -la > /opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/ > total 0 > drwx------ 3 root wheel 102 8 Feb 08:48 . > drwxr-xr-x 8 root wheel 272 8 Feb 08:48 .. > drwxr-xr-x 2 andreas wheel 68 8 Feb 08:48 > gcc-4.6.2-glibc-2.14.1-binutils-2.21.1a-kernel-2.6.39-sanitized > --->8--- > -> (note: this was patched bin/ptxdist with '-m755' in sudo mkdir > path) > -> therefore next commands can not access subdirs of > /opt/OSELAS.Toolchain-2011.11.0/i586-unknown-linux-gnu/ (chmod, > chown) > = > I guess the problem is directories on the way (=3D 'parents') are created > with default credentials -> umask has an effect. But the last directory > in path is set to given parameters (-m755). > = > Can you reproduce this too? Yes, I can. The problem is not actually the umask, but the fact, that we're creating several directory levels with sudo but only change the ownership of the last one. I think we should use 'install -m0755 -d ${dir}' instead. That sets the correct permissions for the parent directories without messing with umask Michael -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de