mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] strange permission behavior
@ 2019-02-20  0:59 Jon Ringle
  2019-02-20 13:17 ` Ian Abbott
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Ringle @ 2019-02-20  0:59 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 876 bytes --]

I've got a strange permission problem when I build on our build server that
was recently updated from Ubuntu-14.04 to Ubuntu-16.04.

On our Ubuntu-16.04 server, on most of the platform/packages/
subdirectories the packages are getting created with other having no
permissions at all:

rootfs/platform-ec1c/packages$ tree -d -L 1 -p
.
├── [drwxr-x---]  attr-2.4.47
├── [drwxr-x---]  avahi-0.7
├── [drwxr-x---]  bash-4.3.30
├── [drwxr-x---]  boost_1_67_0
├── [drwxr-x---]  busybox-1.29.3
├── [drwxr-x---]  coreutils-8.29
...

This results in all files contained within those directories to also have
no perms for other, and get installed on my target in the same way. This in
turn then causes permission problems to occur.

I'm at a loss as to what to look for to resolve this problem.

Suggestions?

Regards,
-Jon

[-- Attachment #1.2: Type: text/html, Size: 1151 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] strange permission behavior
  2019-02-20  0:59 [ptxdist] strange permission behavior Jon Ringle
@ 2019-02-20 13:17 ` Ian Abbott
  2019-02-20 13:22   ` Ian Abbott
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Abbott @ 2019-02-20 13:17 UTC (permalink / raw)
  To: ptxdist, Jon Ringle

On 20/02/2019 00:59, Jon Ringle wrote:
> I've got a strange permission problem when I build on our build server 
> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> 
> On our Ubuntu-16.04 server, on most of the platform/packages/ 
> subdirectories the packages are getting created with other having no 
> permissions at all:
> 
> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> .
> ├── [drwxr-x---]  attr-2.4.47
> ├── [drwxr-x---]  avahi-0.7
> ├── [drwxr-x---]  bash-4.3.30
> ├── [drwxr-x---]  boost_1_67_0
> ├── [drwxr-x---]  busybox-1.29.3
> ├── [drwxr-x---]  coreutils-8.29
> ...
> 
> This results in all files contained within those directories to also 
> have no perms for other, and get installed on my target in the same way. 
> This in turn then causes permission problems to occur.
> 
> I'm at a loss as to what to look for to resolve this problem.
> 
> Suggestions?

I think you are building with umask 0027, so files are created with no 
permissions for 'other' users.  This should not affect the contents of 
the platform-ec1c/packages/*.ipk files, or the contents of the 
platform-ec1c/root/ directory, or the contents of the 
platform-ec1c/images/root.* images, which should all contain files with 
the correct permissions for the target.

If you want the contents of platform-ec1c/packages to be created so that 
they are readable by 'other' users, you can configure your build server 
to build with umask 0022.

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:    )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] strange permission behavior
  2019-02-20 13:17 ` Ian Abbott
@ 2019-02-20 13:22   ` Ian Abbott
  2019-02-20 14:09     ` Jon Ringle
  2019-02-20 14:23     ` Michael Olbrich
  0 siblings, 2 replies; 11+ messages in thread
From: Ian Abbott @ 2019-02-20 13:22 UTC (permalink / raw)
  To: ptxdist, Jon Ringle

On 20/02/2019 13:17, Ian Abbott wrote:
> On 20/02/2019 00:59, Jon Ringle wrote:
>> I've got a strange permission problem when I build on our build server 
>> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
>>
>> On our Ubuntu-16.04 server, on most of the platform/packages/ 
>> subdirectories the packages are getting created with other having no 
>> permissions at all:
>>
>> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
>> .
>> ├── [drwxr-x---]  attr-2.4.47
>> ├── [drwxr-x---]  avahi-0.7
>> ├── [drwxr-x---]  bash-4.3.30
>> ├── [drwxr-x---]  boost_1_67_0
>> ├── [drwxr-x---]  busybox-1.29.3
>> ├── [drwxr-x---]  coreutils-8.29
>> ...
>>
>> This results in all files contained within those directories to also 
>> have no perms for other, and get installed on my target in the same 
>> way. This in turn then causes permission problems to occur.
>>
>> I'm at a loss as to what to look for to resolve this problem.
>>
>> Suggestions?
> 
> I think you are building with umask 0027, so files are created with no 
> permissions for 'other' users.  This should not affect the contents of 
> the platform-ec1c/packages/*.ipk files, or the contents of the 
> platform-ec1c/root/ directory, or the contents of the 
> platform-ec1c/images/root.* images, which should all contain files with 
> the correct permissions for the target.

Correction: The platform-ec1c/root/ directory contents do not have the 
correct ownership for the target, but the file mode bits should be correct.

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:    )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] strange permission behavior
  2019-02-20 13:22   ` Ian Abbott
@ 2019-02-20 14:09     ` Jon Ringle
  2019-02-20 14:42       ` Michael Olbrich
  2019-02-20 14:23     ` Michael Olbrich
  1 sibling, 1 reply; 11+ messages in thread
From: Jon Ringle @ 2019-02-20 14:09 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 4605 bytes --]

On Wed, Feb 20, 2019 at 8:22 AM Ian Abbott <abbotti@mev.co.uk> wrote:

> On 20/02/2019 13:17, Ian Abbott wrote:
> > On 20/02/2019 00:59, Jon Ringle wrote:
> >> I've got a strange permission problem when I build on our build server
> >> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> >>
> >> On our Ubuntu-16.04 server, on most of the platform/packages/
> >> subdirectories the packages are getting created with other having no
> >> permissions at all:
> >>
> >> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> >> .
> >> ├── [drwxr-x---]  attr-2.4.47
> >> ├── [drwxr-x---]  avahi-0.7
> >> ├── [drwxr-x---]  bash-4.3.30
> >> ├── [drwxr-x---]  boost_1_67_0
> >> ├── [drwxr-x---]  busybox-1.29.3
> >> ├── [drwxr-x---]  coreutils-8.29
> >> ...
> >>
> >> This results in all files contained within those directories to also
> >> have no perms for other, and get installed on my target in the same
> >> way. This in turn then causes permission problems to occur.
> >>
> >> I'm at a loss as to what to look for to resolve this problem.
> >>
> >> Suggestions?
> >
> > I think you are building with umask 0027, so files are created with no
> > permissions for 'other' users.  This should not affect the contents of
> > the platform-ec1c/packages/*.ipk files, or the contents of the
> > platform-ec1c/root/ directory, or the contents of the
> > platform-ec1c/images/root.* images, which should all contain files with
> > the correct permissions for the target.
>
> Correction: The platform-ec1c/root/ directory contents do not have the
> correct ownership for the target, but the file mode bits should be correct.
>
>
I also thought that perhaps it was a umask issue, but as you can see below,
umask is 0022, which should be ok.
The permission problem that I am having on the target is that
systemd-networkd.service won't start because it can't read the
configuration files below. These files are installed in systemd.make via:

ifdef PTXCONF_SYSTEMD_NETWORK
        @$(call install_tree, systemd, 0, 0, -, /usr/lib/systemd/network)
        @$(call install_alternative_tree, systemd, 0, 0,
/usr/lib/systemd/network)
endif
        @$(call install_alternative, systemd, 0, 0, 0644, \
                /usr/lib/systemd/network/99-default.link)


The install_tree code resolves the permissions to apply to the files
installed in ptxd_install_generic() found in
scripts/lib/ptxd_make_xpkg_pkg.sh by obtaining the file's permissions via
stat -c:

    stat=( $(stat -c "%u:%g:%a:0x%t:0x%T:%F" "${file}") ) &&
    IFS="${orig_IFS}"
    local usr="${usr:-${stat[0]}}" &&
    local grp="${grp:-${stat[1]}}" &&
    local mod="${stat[2]}" &&
    local major="${stat[3]}" &&
    local minor="${stat[4]}" &&
    local type="${stat[5]}" &&

    case "${type}" in
...
        "regular file"|"regular empty file")
            ptxd_install_file "${file}" "${dst}" "${usr}" "${grp}" "${mod}"
"${strip}"
            ;;


Here is the content of the systemd_239_armel.ipk package:

jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages$ mkdir
temp
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages$ cd
temp/
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp$
ar x ../systemd_239_armel.ipk
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp$
mkdir data
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp$
cd data
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp/data$
tar xf ../data.tar.gz
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp/data$
cd usr/lib/systemd/network/
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp/data/usr/lib/systemd/network$
ll
total 28
drwxr-xr-x 2 jringle domain^users 4096 Jan  1 00:00 ./


drwxr-xr-x 5 jringle domain^users 4096 Jan  1 00:00 ../


-rw-r----- 1 jringle domain^users  645 Jan  1 00:00
80-container-host0.network


-rw-r----- 1 jringle domain^users  718 Jan  1 00:00
80-container-ve.network


-rw-r----- 1 jringle domain^users  704 Jan  1 00:00
80-container-vz.network


-rw-r--r-- 1 jringle domain^users  412 Jan  1 00:00 99-default.link


-rw-r--r-- 1 jringle domain^users   70 Jan  1 00:00 eth0.network


jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp/data/usr/lib/systemd/network$
umask

0022




The same files under platform-ec1c/root/ directory hierarchy have the same
permissions as above.

-Jon

[-- Attachment #1.2: Type: text/html, Size: 12727 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] strange permission behavior
  2019-02-20 13:22   ` Ian Abbott
  2019-02-20 14:09     ` Jon Ringle
@ 2019-02-20 14:23     ` Michael Olbrich
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Olbrich @ 2019-02-20 14:23 UTC (permalink / raw)
  To: ptxdist

On Wed, Feb 20, 2019 at 01:22:25PM +0000, Ian Abbott wrote:
> On 20/02/2019 13:17, Ian Abbott wrote:
> > On 20/02/2019 00:59, Jon Ringle wrote:
> > > I've got a strange permission problem when I build on our build
> > > server that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> > > 
> > > On our Ubuntu-16.04 server, on most of the platform/packages/
> > > subdirectories the packages are getting created with other having no
> > > permissions at all:
> > > 
> > > rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> > > .
> > > ├── [drwxr-x---]  attr-2.4.47
> > > ├── [drwxr-x---]  avahi-0.7
> > > ├── [drwxr-x---]  bash-4.3.30
> > > ├── [drwxr-x---]  boost_1_67_0
> > > ├── [drwxr-x---]  busybox-1.29.3
> > > ├── [drwxr-x---]  coreutils-8.29
> > > ...
> > > 
> > > This results in all files contained within those directories to also
> > > have no perms for other,

This makes no sense. I can see that (with umask 0027) the directories may
have this mode because we create them with 'mkdir' in
ptxd_make_world_install_prepare() and no mode is set.

But the files should have the correct permissions. E.g. 'attr' installs all
files with explicitly specified modes, so that should be independent of the
umask.

> > > and get installed on my target in the same
> > > way. This in turn then causes permission problems to occur.
> > > 
> > > I'm at a loss as to what to look for to resolve this problem.
> > > 
> > > Suggestions?
> > 
> > I think you are building with umask 0027, so files are created with no
> > permissions for 'other' users.  This should not affect the contents of
> > the platform-ec1c/packages/*.ipk files, or the contents of the
> > platform-ec1c/root/ directory, or the contents of the
> > platform-ec1c/images/root.* images, which should all contain files with
> > the correct permissions for the target.

We explicitly set the mode in install_copy, so for the most part it should
be correct regardless of the permissions in packages/. The exceptions are
install_tree, install_glob, etc. Here we pick the mode from the source
file. So there may be some issues with directory permissions.

> Correction: The platform-ec1c/root/ directory contents do not have the
> correct ownership for the target, but the file mode bits should be correct.

For the most part. We also skip any suid bits because they don't make sense
without the ownership.

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] 11+ messages in thread

* Re: [ptxdist] strange permission behavior
  2019-02-20 14:09     ` Jon Ringle
@ 2019-02-20 14:42       ` Michael Olbrich
  2019-02-20 15:10         ` Jon Ringle
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Olbrich @ 2019-02-20 14:42 UTC (permalink / raw)
  To: ptxdist

[-- Attachment #1: Type: text/plain, Size: 3034 bytes --]

On Wed, Feb 20, 2019 at 09:09:18AM -0500, Jon Ringle wrote:
> On Wed, Feb 20, 2019 at 8:22 AM Ian Abbott <abbotti@mev.co.uk> wrote:
> 
> > On 20/02/2019 13:17, Ian Abbott wrote:
> > > On 20/02/2019 00:59, Jon Ringle wrote:
> > >> I've got a strange permission problem when I build on our build server
> > >> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> > >>
> > >> On our Ubuntu-16.04 server, on most of the platform/packages/
> > >> subdirectories the packages are getting created with other having no
> > >> permissions at all:
> > >>
> > >> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> > >> .
> > >> ├── [drwxr-x---]  attr-2.4.47
> > >> ├── [drwxr-x---]  avahi-0.7
> > >> ├── [drwxr-x---]  bash-4.3.30
> > >> ├── [drwxr-x---]  boost_1_67_0
> > >> ├── [drwxr-x---]  busybox-1.29.3
> > >> ├── [drwxr-x---]  coreutils-8.29
> > >> ...
> > >>
> > >> This results in all files contained within those directories to also
> > >> have no perms for other, and get installed on my target in the same
> > >> way. This in turn then causes permission problems to occur.
> > >>
> > >> I'm at a loss as to what to look for to resolve this problem.
> > >>
> > >> Suggestions?
> > >
> > > I think you are building with umask 0027, so files are created with no
> > > permissions for 'other' users.  This should not affect the contents of
> > > the platform-ec1c/packages/*.ipk files, or the contents of the
> > > platform-ec1c/root/ directory, or the contents of the
> > > platform-ec1c/images/root.* images, which should all contain files with
> > > the correct permissions for the target.
> >
> > Correction: The platform-ec1c/root/ directory contents do not have the
> > correct ownership for the target, but the file mode bits should be correct.
> >
> >
> I also thought that perhaps it was a umask issue, but as you can see below,
> umask is 0022, which should be ok.
> The permission problem that I am having on the target is that
> systemd-networkd.service won't start because it can't read the
> configuration files below. These files are installed in systemd.make via:
> 
> ifdef PTXCONF_SYSTEMD_NETWORK
>         @$(call install_tree, systemd, 0, 0, -, /usr/lib/systemd/network)
>         @$(call install_alternative_tree, systemd, 0, 0,
> /usr/lib/systemd/network)
> endif
>         @$(call install_alternative, systemd, 0, 0, 0644, \
>                 /usr/lib/systemd/network/99-default.link)

Right, install_alternative_tree picks the source file permissions. The
question is, why are those incorrect?

I've come across some issues with fakeroot and permissions elsewhere. Can
you run the attached script with the fakeroot from sysroot-host/ and send
the results?

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 |

[-- Attachment #2: fake-test --]
[-- Type: text/plain, Size: 171 bytes --]

#!/bin/sh
umask 022
touch empty
chmod 0644 empty
cp -a empty empty-a
cp -r --preserve=ownership,timestamps,links empty empty-r
ls -l -n empty*
getfacl -n empty*
rm empty*

[-- Attachment #3: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] strange permission behavior
  2019-02-20 14:42       ` Michael Olbrich
@ 2019-02-20 15:10         ` Jon Ringle
  2019-02-20 15:20           ` Michael Olbrich
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Ringle @ 2019-02-20 15:10 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 4458 bytes --]

On Wed, Feb 20, 2019 at 9:42 AM Michael Olbrich <m.olbrich@pengutronix.de>
wrote:

> On Wed, Feb 20, 2019 at 09:09:18AM -0500, Jon Ringle wrote:
> > On Wed, Feb 20, 2019 at 8:22 AM Ian Abbott <abbotti@mev.co.uk> wrote:
> >
> > > On 20/02/2019 13:17, Ian Abbott wrote:
> > > > On 20/02/2019 00:59, Jon Ringle wrote:
> > > >> I've got a strange permission problem when I build on our build
> server
> > > >> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> > > >>
> > > >> On our Ubuntu-16.04 server, on most of the platform/packages/
> > > >> subdirectories the packages are getting created with other having no
> > > >> permissions at all:
> > > >>
> > > >> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> > > >> .
> > > >> ├── [drwxr-x---]  attr-2.4.47
> > > >> ├── [drwxr-x---]  avahi-0.7
> > > >> ├── [drwxr-x---]  bash-4.3.30
> > > >> ├── [drwxr-x---]  boost_1_67_0
> > > >> ├── [drwxr-x---]  busybox-1.29.3
> > > >> ├── [drwxr-x---]  coreutils-8.29
> > > >> ...
> > > >>
> > > >> This results in all files contained within those directories to also
> > > >> have no perms for other, and get installed on my target in the same
> > > >> way. This in turn then causes permission problems to occur.
> > > >>
> > > >> I'm at a loss as to what to look for to resolve this problem.
> > > >>
> > > >> Suggestions?
> > > >
> > > > I think you are building with umask 0027, so files are created with
> no
> > > > permissions for 'other' users.  This should not affect the contents
> of
> > > > the platform-ec1c/packages/*.ipk files, or the contents of the
> > > > platform-ec1c/root/ directory, or the contents of the
> > > > platform-ec1c/images/root.* images, which should all contain files
> with
> > > > the correct permissions for the target.
> > >
> > > Correction: The platform-ec1c/root/ directory contents do not have the
> > > correct ownership for the target, but the file mode bits should be
> correct.
> > >
> > >
> > I also thought that perhaps it was a umask issue, but as you can see
> below,
> > umask is 0022, which should be ok.
> > The permission problem that I am having on the target is that
> > systemd-networkd.service won't start because it can't read the
> > configuration files below. These files are installed in systemd.make via:
> >
> > ifdef PTXCONF_SYSTEMD_NETWORK
> >         @$(call install_tree, systemd, 0, 0, -, /usr/lib/systemd/network)
> >         @$(call install_alternative_tree, systemd, 0, 0,
> > /usr/lib/systemd/network)
> > endif
> >         @$(call install_alternative, systemd, 0, 0, 0644, \
> >                 /usr/lib/systemd/network/99-default.link)
>
> Right, install_alternative_tree picks the source file permissions. The
> question is, why are those incorrect?
>
> I've come across some issues with fakeroot and permissions elsewhere. Can
> you run the attached script with the fakeroot from sysroot-host/ and send
> the results?
>
>
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/sysroot-host/bin$
./fakeroot ~/fake-test
fakeroot: preload library `libfakeroot.so' not found, aborting.
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/sysroot-host/bin$
cd ../../..
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ ptxdist bash
[ptx] jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ which fakeroot
/srv/gpec-build/rootfs/platform-ec1k/sysroot-host/bin/fakeroot
[ptx] jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ fakeroot ~/fake-test
-rw-r--r-- 1 0 0 0 Feb 20 15:08 empty
-rw-r--r-- 1 0 0 0 Feb 20 15:08 empty-a
-rw-r--r-- 1 0 0 0 Feb 20 15:08 empty-r
# file: empty
# owner: 0
# group: 0
user::rw-
group::r--
other::r--

# file: empty-a
# owner: 0
# group: 0
user::rw-
group::r--
other::r--

# file: empty-r
# owner: 0
# group: 0
user::rw-
group::r--
other::r--

[ptx] jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ exit
exit
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ which fakeroot
/usr/bin/fakeroot
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ fakeroot ~/fake-test
-rw-r--r-- 1 0 0 0 Feb 20 15:08 empty
-rw-r--r-- 1 0 0 0 Feb 20 15:08 empty-a
-rw-r--r-- 1 0 0 0 Feb 20 15:08 empty-r
# file: empty
# owner: 0
# group: 0
user::rw-
group::r--
other::r--

# file: empty-a
# owner: 0
# group: 0
user::rw-
group::r--
other::r--

# file: empty-r
# owner: 0
# group: 0
user::rw-
group::r--
other::r--

[-- Attachment #1.2: Type: text/html, Size: 6010 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] strange permission behavior
  2019-02-20 15:10         ` Jon Ringle
@ 2019-02-20 15:20           ` Michael Olbrich
  2019-02-20 15:29             ` Jon Ringle
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Olbrich @ 2019-02-20 15:20 UTC (permalink / raw)
  To: ptxdist

On Wed, Feb 20, 2019 at 10:10:01AM -0500, Jon Ringle wrote:
> On Wed, Feb 20, 2019 at 9:42 AM Michael Olbrich <m.olbrich@pengutronix.de>
> wrote:
> > On Wed, Feb 20, 2019 at 09:09:18AM -0500, Jon Ringle wrote:
> > > On Wed, Feb 20, 2019 at 8:22 AM Ian Abbott <abbotti@mev.co.uk> wrote:
> > >
> > > > On 20/02/2019 13:17, Ian Abbott wrote:
> > > > > On 20/02/2019 00:59, Jon Ringle wrote:
> > > > >> I've got a strange permission problem when I build on our build
> > server
> > > > >> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> > > > >>
> > > > >> On our Ubuntu-16.04 server, on most of the platform/packages/
> > > > >> subdirectories the packages are getting created with other having no
> > > > >> permissions at all:
> > > > >>
> > > > >> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> > > > >> .
> > > > >> ├── [drwxr-x---]  attr-2.4.47
> > > > >> ├── [drwxr-x---]  avahi-0.7
> > > > >> ├── [drwxr-x---]  bash-4.3.30
> > > > >> ├── [drwxr-x---]  boost_1_67_0
> > > > >> ├── [drwxr-x---]  busybox-1.29.3
> > > > >> ├── [drwxr-x---]  coreutils-8.29
> > > > >> ...
> > > > >>
> > > > >> This results in all files contained within those directories to also
> > > > >> have no perms for other, and get installed on my target in the same
> > > > >> way. This in turn then causes permission problems to occur.
> > > > >>
> > > > >> I'm at a loss as to what to look for to resolve this problem.
> > > > >>
> > > > >> Suggestions?
> > > > >
> > > > > I think you are building with umask 0027, so files are created with
> > no
> > > > > permissions for 'other' users.  This should not affect the contents
> > of
> > > > > the platform-ec1c/packages/*.ipk files, or the contents of the
> > > > > platform-ec1c/root/ directory, or the contents of the
> > > > > platform-ec1c/images/root.* images, which should all contain files
> > with
> > > > > the correct permissions for the target.
> > > >
> > > > Correction: The platform-ec1c/root/ directory contents do not have the
> > > > correct ownership for the target, but the file mode bits should be
> > correct.
> > > >
> > > >
> > > I also thought that perhaps it was a umask issue, but as you can see
> > below,
> > > umask is 0022, which should be ok.
> > > The permission problem that I am having on the target is that
> > > systemd-networkd.service won't start because it can't read the
> > > configuration files below. These files are installed in systemd.make via:
> > >
> > > ifdef PTXCONF_SYSTEMD_NETWORK
> > >         @$(call install_tree, systemd, 0, 0, -, /usr/lib/systemd/network)
> > >         @$(call install_alternative_tree, systemd, 0, 0,
> > > /usr/lib/systemd/network)

Another idea: This is in ptxdist or your BSP. What are the files
permissions there?

> > > endif
> > >         @$(call install_alternative, systemd, 0, 0, 0644, \
> > >                 /usr/lib/systemd/network/99-default.link)
> >
> > Right, install_alternative_tree picks the source file permissions. The
> > question is, why are those incorrect?
> >
> > I've come across some issues with fakeroot and permissions elsewhere. Can
> > you run the attached script with the fakeroot from sysroot-host/ and send
> > the results?
V> >
> >
> jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/sysroot-host/bin$
> ./fakeroot ~/fake-test
> fakeroot: preload library `libfakeroot.so' not found, aborting.
> jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/sysroot-host/bin$
> cd ../../..
> jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ ptxdist bash
> [ptx] jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ which fakeroot
> /srv/gpec-build/rootfs/platform-ec1k/sysroot-host/bin/fakeroot
> [ptx] jringle@dev-atl-bamb01:/srv/gpec-build/rootfs$ fakeroot ~/fake-test
[...]

This looks all ok.

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] 11+ messages in thread

* Re: [ptxdist] strange permission behavior
  2019-02-20 15:20           ` Michael Olbrich
@ 2019-02-20 15:29             ` Jon Ringle
  2019-02-20 15:43               ` Michael Olbrich
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Ringle @ 2019-02-20 15:29 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 4312 bytes --]

On Wed, Feb 20, 2019 at 10:20 AM Michael Olbrich <m.olbrich@pengutronix.de>
wrote:

> On Wed, Feb 20, 2019 at 10:10:01AM -0500, Jon Ringle wrote:
> > On Wed, Feb 20, 2019 at 9:42 AM Michael Olbrich <
> m.olbrich@pengutronix.de>
> > wrote:
> > > On Wed, Feb 20, 2019 at 09:09:18AM -0500, Jon Ringle wrote:
> > > > On Wed, Feb 20, 2019 at 8:22 AM Ian Abbott <abbotti@mev.co.uk>
> wrote:
> > > >
> > > > > On 20/02/2019 13:17, Ian Abbott wrote:
> > > > > > On 20/02/2019 00:59, Jon Ringle wrote:
> > > > > >> I've got a strange permission problem when I build on our build
> > > server
> > > > > >> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> > > > > >>
> > > > > >> On our Ubuntu-16.04 server, on most of the platform/packages/
> > > > > >> subdirectories the packages are getting created with other
> having no
> > > > > >> permissions at all:
> > > > > >>
> > > > > >> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> > > > > >> .
> > > > > >> ├── [drwxr-x---]  attr-2.4.47
> > > > > >> ├── [drwxr-x---]  avahi-0.7
> > > > > >> ├── [drwxr-x---]  bash-4.3.30
> > > > > >> ├── [drwxr-x---]  boost_1_67_0
> > > > > >> ├── [drwxr-x---]  busybox-1.29.3
> > > > > >> ├── [drwxr-x---]  coreutils-8.29
> > > > > >> ...
> > > > > >>
> > > > > >> This results in all files contained within those directories to
> also
> > > > > >> have no perms for other, and get installed on my target in the
> same
> > > > > >> way. This in turn then causes permission problems to occur.
> > > > > >>
> > > > > >> I'm at a loss as to what to look for to resolve this problem.
> > > > > >>
> > > > > >> Suggestions?
> > > > > >
> > > > > > I think you are building with umask 0027, so files are created
> with
> > > no
> > > > > > permissions for 'other' users.  This should not affect the
> contents
> > > of
> > > > > > the platform-ec1c/packages/*.ipk files, or the contents of the
> > > > > > platform-ec1c/root/ directory, or the contents of the
> > > > > > platform-ec1c/images/root.* images, which should all contain
> files
> > > with
> > > > > > the correct permissions for the target.
> > > > >
> > > > > Correction: The platform-ec1c/root/ directory contents do not have
> the
> > > > > correct ownership for the target, but the file mode bits should be
> > > correct.
> > > > >
> > > > >
> > > > I also thought that perhaps it was a umask issue, but as you can see
> > > below,
> > > > umask is 0022, which should be ok.
> > > > The permission problem that I am having on the target is that
> > > > systemd-networkd.service won't start because it can't read the
> > > > configuration files below. These files are installed in systemd.make
> via:
> > > >
> > > > ifdef PTXCONF_SYSTEMD_NETWORK
> > > >         @$(call install_tree, systemd, 0, 0, -,
> /usr/lib/systemd/network)
> > > >         @$(call install_alternative_tree, systemd, 0, 0,
> > > > /usr/lib/systemd/network)
>
> Another idea: This is in ptxdist or your BSP. What are the files
> permissions there?
>
>
My BSP doesn't have the directory, projectroot/usr/lib/systemd/network/

ptxdist projectroot is providing eth0.network, that has the correct
permissions.
jringle@dev-atl-bamb01:/usr/local/lib/ptxdist-2019.01.0_GP/projectroot/usr/lib/systemd/network$
ll
total 12
drwxr-xr-x 2 root root 4096 Feb 12 05:18 ./
drwxr-xr-x 4 root root 4096 Feb 12 05:18 ../
-rw-r--r-- 1 root root   70 Feb 12 05:18 eth0.network

The 80-container-*.network files that have the wrong permissions are coming
from the install_tree, not the install_alternative_tree, which is provided
by the systemd itself:
jringle@dev-atl-bamb01:/srv/gpec-build/rootfs/platform-ec1c/packages/temp/data/usr/lib/systemd/network$
ll
total 28
drwxr-xr-x 2 jringle domain^users 4096 Jan  1 00:00 ./


drwxr-xr-x 5 jringle domain^users 4096 Jan  1 00:00 ../


-rw-r----- 1 jringle domain^users  645 Jan  1 00:00
80-container-host0.network


-rw-r----- 1 jringle domain^users  718 Jan  1 00:00
80-container-ve.network


-rw-r----- 1 jringle domain^users  704 Jan  1 00:00
80-container-vz.network


-rw-r--r-- 1 jringle domain^users  412 Jan  1 00:00 99-default.link


-rw-r--r-- 1 jringle domain^users   70 Jan  1 00:00 eth0.network

[-- Attachment #1.2: Type: text/html, Size: 8343 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] strange permission behavior
  2019-02-20 15:29             ` Jon Ringle
@ 2019-02-20 15:43               ` Michael Olbrich
  2019-02-21 13:47                 ` Jon Ringle
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Olbrich @ 2019-02-20 15:43 UTC (permalink / raw)
  To: ptxdist

On Wed, Feb 20, 2019 at 10:29:45AM -0500, Jon Ringle wrote:
> On Wed, Feb 20, 2019 at 10:20 AM Michael Olbrich <m.olbrich@pengutronix.de>
> wrote:
> > On Wed, Feb 20, 2019 at 10:10:01AM -0500, Jon Ringle wrote:
> > > On Wed, Feb 20, 2019 at 9:42 AM Michael Olbrich <
> > m.olbrich@pengutronix.de>
> > > wrote:
> > > > On Wed, Feb 20, 2019 at 09:09:18AM -0500, Jon Ringle wrote:
> > > > > On Wed, Feb 20, 2019 at 8:22 AM Ian Abbott <abbotti@mev.co.uk>
> > wrote:
> > > > >
> > > > > > On 20/02/2019 13:17, Ian Abbott wrote:
> > > > > > > On 20/02/2019 00:59, Jon Ringle wrote:
> > > > > > >> I've got a strange permission problem when I build on our build
> > > > server
> > > > > > >> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> > > > > > >>
> > > > > > >> On our Ubuntu-16.04 server, on most of the platform/packages/
> > > > > > >> subdirectories the packages are getting created with other
> > having no
> > > > > > >> permissions at all:
> > > > > > >>
> > > > > > >> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> > > > > > >> .
> > > > > > >> ├── [drwxr-x---]  attr-2.4.47
> > > > > > >> ├── [drwxr-x---]  avahi-0.7
> > > > > > >> ├── [drwxr-x---]  bash-4.3.30
> > > > > > >> ├── [drwxr-x---]  boost_1_67_0
> > > > > > >> ├── [drwxr-x---]  busybox-1.29.3
> > > > > > >> ├── [drwxr-x---]  coreutils-8.29
> > > > > > >> ...
> > > > > > >>
> > > > > > >> This results in all files contained within those directories to
> > also
> > > > > > >> have no perms for other, and get installed on my target in the
> > same
> > > > > > >> way. This in turn then causes permission problems to occur.
> > > > > > >>
> > > > > > >> I'm at a loss as to what to look for to resolve this problem.
> > > > > > >>
> > > > > > >> Suggestions?
> > > > > > >
> > > > > > > I think you are building with umask 0027, so files are created
> > with
> > > > no
> > > > > > > permissions for 'other' users.  This should not affect the
> > contents
> > > > of
> > > > > > > the platform-ec1c/packages/*.ipk files, or the contents of the
> > > > > > > platform-ec1c/root/ directory, or the contents of the
> > > > > > > platform-ec1c/images/root.* images, which should all contain
> > files
> > > > with
> > > > > > > the correct permissions for the target.
> > > > > >
> > > > > > Correction: The platform-ec1c/root/ directory contents do not have
> > the
> > > > > > correct ownership for the target, but the file mode bits should be
> > > > correct.
> > > > > >
> > > > > >
> > > > > I also thought that perhaps it was a umask issue, but as you can see
> > > > below,
> > > > > umask is 0022, which should be ok.
> > > > > The permission problem that I am having on the target is that
> > > > > systemd-networkd.service won't start because it can't read the
> > > > > configuration files below. These files are installed in systemd.make
> > via:
> > > > >
> > > > > ifdef PTXCONF_SYSTEMD_NETWORK
> > > > >         @$(call install_tree, systemd, 0, 0, -,
> > /usr/lib/systemd/network)
> > > > >         @$(call install_alternative_tree, systemd, 0, 0,
> > > > > /usr/lib/systemd/network)
> >
> > Another idea: This is in ptxdist or your BSP. What are the files
> > permissions there?
> >
> >
> My BSP doesn't have the directory, projectroot/usr/lib/systemd/network/
> 
> ptxdist projectroot is providing eth0.network, that has the correct
> permissions.
> jringle@dev-atl-bamb01:/usr/local/lib/ptxdist-2019.01.0_GP/projectroot/usr/lib/systemd/network$
> ll
> total 12
> drwxr-xr-x 2 root root 4096 Feb 12 05:18 ./
> drwxr-xr-x 4 root root 4096 Feb 12 05:18 ../
> -rw-r--r-- 1 root root   70 Feb 12 05:18 eth0.network
> 
> The 80-container-*.network files that have the wrong permissions are coming
> from the install_tree, not the install_alternative_tree, which is provided
> by the systemd itself:

Ok, lets start at the beginning. The directories in packages/ (and some of
the subdirectories are created with 'mkdir -p'. If you do that manually,
what kind of permissions do you get there?

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] 11+ messages in thread

* Re: [ptxdist] strange permission behavior
  2019-02-20 15:43               ` Michael Olbrich
@ 2019-02-21 13:47                 ` Jon Ringle
  0 siblings, 0 replies; 11+ messages in thread
From: Jon Ringle @ 2019-02-21 13:47 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 4891 bytes --]

On Wed, Feb 20, 2019 at 10:43 AM Michael Olbrich <m.olbrich@pengutronix.de>
wrote:

> On Wed, Feb 20, 2019 at 10:29:45AM -0500, Jon Ringle wrote:
> > On Wed, Feb 20, 2019 at 10:20 AM Michael Olbrich <
> m.olbrich@pengutronix.de>
> > wrote:
> > > On Wed, Feb 20, 2019 at 10:10:01AM -0500, Jon Ringle wrote:
> > > > On Wed, Feb 20, 2019 at 9:42 AM Michael Olbrich <
> > > m.olbrich@pengutronix.de>
> > > > wrote:
> > > > > On Wed, Feb 20, 2019 at 09:09:18AM -0500, Jon Ringle wrote:
> > > > > > On Wed, Feb 20, 2019 at 8:22 AM Ian Abbott <abbotti@mev.co.uk>
> > > wrote:
> > > > > >
> > > > > > > On 20/02/2019 13:17, Ian Abbott wrote:
> > > > > > > > On 20/02/2019 00:59, Jon Ringle wrote:
> > > > > > > >> I've got a strange permission problem when I build on our
> build
> > > > > server
> > > > > > > >> that was recently updated from Ubuntu-14.04 to Ubuntu-16.04.
> > > > > > > >>
> > > > > > > >> On our Ubuntu-16.04 server, on most of the
> platform/packages/
> > > > > > > >> subdirectories the packages are getting created with other
> > > having no
> > > > > > > >> permissions at all:
> > > > > > > >>
> > > > > > > >> rootfs/platform-ec1c/packages$ tree -d -L 1 -p
> > > > > > > >> .
> > > > > > > >> ├── [drwxr-x---]  attr-2.4.47
> > > > > > > >> ├── [drwxr-x---]  avahi-0.7
> > > > > > > >> ├── [drwxr-x---]  bash-4.3.30
> > > > > > > >> ├── [drwxr-x---]  boost_1_67_0
> > > > > > > >> ├── [drwxr-x---]  busybox-1.29.3
> > > > > > > >> ├── [drwxr-x---]  coreutils-8.29
> > > > > > > >> ...
> > > > > > > >>
> > > > > > > >> This results in all files contained within those
> directories to
> > > also
> > > > > > > >> have no perms for other, and get installed on my target in
> the
> > > same
> > > > > > > >> way. This in turn then causes permission problems to occur.
> > > > > > > >>
> > > > > > > >> I'm at a loss as to what to look for to resolve this
> problem.
> > > > > > > >>
> > > > > > > >> Suggestions?
> > > > > > > >
> > > > > > > > I think you are building with umask 0027, so files are
> created
> > > with
> > > > > no
> > > > > > > > permissions for 'other' users.  This should not affect the
> > > contents
> > > > > of
> > > > > > > > the platform-ec1c/packages/*.ipk files, or the contents of
> the
> > > > > > > > platform-ec1c/root/ directory, or the contents of the
> > > > > > > > platform-ec1c/images/root.* images, which should all contain
> > > files
> > > > > with
> > > > > > > > the correct permissions for the target.
> > > > > > >
> > > > > > > Correction: The platform-ec1c/root/ directory contents do not
> have
> > > the
> > > > > > > correct ownership for the target, but the file mode bits
> should be
> > > > > correct.
> > > > > > >
> > > > > > >
> > > > > > I also thought that perhaps it was a umask issue, but as you can
> see
> > > > > below,
> > > > > > umask is 0022, which should be ok.
> > > > > > The permission problem that I am having on the target is that
> > > > > > systemd-networkd.service won't start because it can't read the
> > > > > > configuration files below. These files are installed in
> systemd.make
> > > via:
> > > > > >
> > > > > > ifdef PTXCONF_SYSTEMD_NETWORK
> > > > > >         @$(call install_tree, systemd, 0, 0, -,
> > > /usr/lib/systemd/network)
> > > > > >         @$(call install_alternative_tree, systemd, 0, 0,
> > > > > > /usr/lib/systemd/network)
> > >
> > > Another idea: This is in ptxdist or your BSP. What are the files
> > > permissions there?
> > >
> > >
> > My BSP doesn't have the directory, projectroot/usr/lib/systemd/network/
> >
> > ptxdist projectroot is providing eth0.network, that has the correct
> > permissions.
> > jringle@dev-atl-bamb01
> :/usr/local/lib/ptxdist-2019.01.0_GP/projectroot/usr/lib/systemd/network$
> > ll
> > total 12
> > drwxr-xr-x 2 root root 4096 Feb 12 05:18 ./
> > drwxr-xr-x 4 root root 4096 Feb 12 05:18 ../
> > -rw-r--r-- 1 root root   70 Feb 12 05:18 eth0.network
> >
> > The 80-container-*.network files that have the wrong permissions are
> coming
> > from the install_tree, not the install_alternative_tree, which is
> provided
> > by the systemd itself:
>
> Ok, lets start at the beginning. The directories in packages/ (and some of
> the subdirectories are created with 'mkdir -p'. If you do that manually,
> what kind of permissions do you get there?
>
>
No need. The problem was introduced by a new version of bamboo that we had
installed that changed the umask to 0027 for builds done via bamboo. This
also caused the permissions to be incorrect on DEVPKGS that were used by
further builds. Problem was fixed as described in the link below and be
deleting and recreating the DEVPKGS.

See
https://community.atlassian.com/t5/Bamboo-questions/Permissions-trouble/qaq-p/930046

-Jon

[-- Attachment #1.2: Type: text/html, Size: 7034 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2019-02-21 13:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20  0:59 [ptxdist] strange permission behavior Jon Ringle
2019-02-20 13:17 ` Ian Abbott
2019-02-20 13:22   ` Ian Abbott
2019-02-20 14:09     ` Jon Ringle
2019-02-20 14:42       ` Michael Olbrich
2019-02-20 15:10         ` Jon Ringle
2019-02-20 15:20           ` Michael Olbrich
2019-02-20 15:29             ` Jon Ringle
2019-02-20 15:43               ` Michael Olbrich
2019-02-21 13:47                 ` Jon Ringle
2019-02-20 14:23     ` Michael Olbrich

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