mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] configure: add GNU mkdir check
@ 2012-02-07 22:40 Andreas Bießmann
  2012-02-08  7:05 ` Michael Olbrich
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Bießmann @ 2012-02-07 22:40 UTC (permalink / raw)
  To: PTXdist ML

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
---
 Makefile.in  |    1 +
 configure.ac |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 358e9c9..e8544d1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,6 +49,7 @@ environment:
 	@ln -sf @GNU_rm@ "$(abs_srcdir)/bin/rm"
 	@ln -sf @GNU_rmdir@ "$(abs_srcdir)/bin/rmdir"
 	@ln -sf @GNU_md5sum@ "$(abs_srcdir)/bin/md5sum"
+	@ln -sf @GNU_mkdir@ "$(abs_srcdir)/bin/mkdir"
 	@ln -sf @GNU_install@ "$(abs_srcdir)/bin/install"
 	@ln -sf @GNU_stat@ "$(abs_srcdir)/bin/stat"
 	@ln -sf @PYTHON@ "$(abs_srcdir)/bin/python"
diff --git a/configure.ac b/configure.ac
index aa25dc8..00c2521 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,6 +149,7 @@ GNU_COREUTILS(cp)
 GNU_COREUTILS(rm)
 GNU_COREUTILS(rmdir)
 GNU_COREUTILS(md5sum)
+GNU_COREUTILS(mkdir)
 GNU_COREUTILS(install)
 GNU_COREUTILS(stat)
 
-- 
1.7.9


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH] configure: add GNU mkdir check
  2012-02-07 22:40 [ptxdist] [PATCH] configure: add GNU mkdir check Andreas Bießmann
@ 2012-02-08  7:05 ` Michael Olbrich
  2012-02-08  7:40   ` Andreas Bießmann
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Olbrich @ 2012-02-08  7:05 UTC (permalink / raw)
  To: ptxdist

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.

Michael

> ---
>  Makefile.in  |    1 +
>  configure.ac |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/Makefile.in b/Makefile.in
> index 358e9c9..e8544d1 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -49,6 +49,7 @@ environment:
>  	@ln -sf @GNU_rm@ "$(abs_srcdir)/bin/rm"
>  	@ln -sf @GNU_rmdir@ "$(abs_srcdir)/bin/rmdir"
>  	@ln -sf @GNU_md5sum@ "$(abs_srcdir)/bin/md5sum"
> +	@ln -sf @GNU_mkdir@ "$(abs_srcdir)/bin/mkdir"
>  	@ln -sf @GNU_install@ "$(abs_srcdir)/bin/install"
>  	@ln -sf @GNU_stat@ "$(abs_srcdir)/bin/stat"
>  	@ln -sf @PYTHON@ "$(abs_srcdir)/bin/python"
> diff --git a/configure.ac b/configure.ac
> index aa25dc8..00c2521 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -149,6 +149,7 @@ GNU_COREUTILS(cp)
>  GNU_COREUTILS(rm)
>  GNU_COREUTILS(rmdir)
>  GNU_COREUTILS(md5sum)
> +GNU_COREUTILS(mkdir)
>  GNU_COREUTILS(install)
>  GNU_COREUTILS(stat)
>  
> -- 
> 1.7.9
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH] configure: add GNU mkdir check
  2012-02-08  7:05 ` Michael Olbrich
@ 2012-02-08  7:40   ` Andreas Bießmann
  2012-02-08  7:56     ` Andreas Bießmann
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Bießmann @ 2012-02-08  7:40 UTC (permalink / raw)
  To: ptxdist

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.

best regards

Andreas Bießmann

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH] configure: add GNU mkdir check
  2012-02-08  7:40   ` Andreas Bießmann
@ 2012-02-08  7:56     ` Andreas Bießmann
  2012-02-08  9:40       ` Michael Olbrich
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Bießmann @ 2012-02-08  7:56 UTC (permalink / raw)
  To: ptxdist

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?

best regards

Andreas Bießmann

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH] configure: add GNU mkdir check
  2012-02-08  7:56     ` Andreas Bießmann
@ 2012-02-08  9:40       ` Michael Olbrich
  2012-02-08  9:57         ` Andreas Bießmann
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Olbrich @ 2012-02-08  9:40 UTC (permalink / raw)
  To: ptxdist

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH] configure: add GNU mkdir check
  2012-02-08  9:40       ` Michael Olbrich
@ 2012-02-08  9:57         ` Andreas Bießmann
  2012-02-08 10:55           ` Michael Olbrich
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Bießmann @ 2012-02-08  9:57 UTC (permalink / raw)
  To: ptxdist

Hi Michael,

On 08.02.2012 10:40, Michael Olbrich wrote:
> 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:

<snip>

>> 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

Ok, so will you provide a proper patch?

regards

Andreas Bießmann

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH] configure: add GNU mkdir check
  2012-02-08  9:57         ` Andreas Bießmann
@ 2012-02-08 10:55           ` Michael Olbrich
  2012-02-08 11:44             ` Andreas Bießmann
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Olbrich @ 2012-02-08 10:55 UTC (permalink / raw)
  To: ptxdist

On Wed, Feb 08, 2012 at 10:57:57AM +0100, Andreas Bießmann wrote:
> On 08.02.2012 10:40, Michael Olbrich wrote:
> > 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:
> 
> <snip>
> 
> >> 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
> 
> Ok, so will you provide a proper patch?

I've pushed a patch. Please verify it works.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH] configure: add GNU mkdir check
  2012-02-08 10:55           ` Michael Olbrich
@ 2012-02-08 11:44             ` Andreas Bießmann
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Bießmann @ 2012-02-08 11:44 UTC (permalink / raw)
  To: ptxdist

Hi,

On 08.02.2012 11:55, Michael Olbrich wrote:
> On Wed, Feb 08, 2012 at 10:57:57AM +0100, Andreas Bießmann wrote:
>> On 08.02.2012 10:40, Michael Olbrich wrote:
>>> 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:
>>
>> <snip>
>>
>>>> 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
>>
>> Ok, so will you provide a proper patch?
> 
> I've pushed a patch. Please verify it works.

I can confirm the 'install -m755' approach works

regards

Andreas Bießmann

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-08 11:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07 22:40 [ptxdist] [PATCH] configure: add GNU mkdir check 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
2012-02-08  9:57         ` Andreas Bießmann
2012-02-08 10:55           ` Michael Olbrich
2012-02-08 11:44             ` Andreas Bießmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox