From: Jon Ringle <jon@ringle.org>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] strange permission behavior
Date: Wed, 20 Feb 2019 09:09:18 -0500 [thread overview]
Message-ID: <CAMwGMjy_v5TB4LOVnz=6H1XOHDzyrrPXh_1w55mPZePpfw2YaQ@mail.gmail.com> (raw)
In-Reply-To: <b863fef0-938e-a72a-9d8b-bc1b52c151d5@mev.co.uk>
[-- 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
next prev parent reply other threads:[~2019-02-20 14:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-20 0:59 Jon Ringle
2019-02-20 13:17 ` Ian Abbott
2019-02-20 13:22 ` Ian Abbott
2019-02-20 14:09 ` Jon Ringle [this message]
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
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='CAMwGMjy_v5TB4LOVnz=6H1XOHDzyrrPXh_1w55mPZePpfw2YaQ@mail.gmail.com' \
--to=jon@ringle.org \
--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