From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] configure: add GNU mkdir check
Date: Wed, 8 Feb 2012 10:40:57 +0100 [thread overview]
Message-ID: <20120208094057.GN32645@pengutronix.de> (raw)
In-Reply-To: <4F322AAE.6090800@biessmann.de>
On Wed, Feb 08, 2012 at 08:56:30AM +0100, Andreas Bießmann wrote:
> Hi again ...
>
> On 08.02.12 08:40, Andreas Bießmann wrote:
> > Hi Michael,
> >
> > On 08.02.12 08:05, Michael Olbrich wrote:
> >> On Tue, Feb 07, 2012 at 11:40:37PM +0100, Andreas Bießmann wrote:
> >>> Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
> >>
> >> Does this mean the uname patch is not needed? I don't mind applying this
> >> patch either way, but I'd like know if the original problem still exists.
> >
> > 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.../<arch>.../gcc-<version>... -> 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 (= '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
next prev parent reply other threads:[~2012-02-08 9:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 22:40 Andreas Bießmann
2012-02-08 7:05 ` Michael Olbrich
2012-02-08 7:40 ` Andreas Bießmann
2012-02-08 7:56 ` Andreas Bießmann
2012-02-08 9:40 ` Michael Olbrich [this message]
2012-02-08 9:57 ` Andreas Bießmann
2012-02-08 10:55 ` Michael Olbrich
2012-02-08 11:44 ` Andreas Bießmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120208094057.GN32645@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox