You are not logged in.

#1 2019-10-30 10:36:43

ectospasm
Member
Registered: 2015-08-28
Posts: 40

[SOLVED] pikaur and 750 permissions

[SOLVED] Due to the disk space requirements of mongodb (needs nearly 200G in default configuration), the ~/.cache/pikaur directory was a symlink to an NFS share with more capacity.  The interaction of that absolute path was causing the permissions to be 750.  I'm not 100 percent clear on why that was the case, but now that I'm using mongodb-bin, I don't need the symlink any longer.  Removing that symlink caused pikaur to create a new directory in its place, and the `stat` commands I placed into the plex-media-server PKGBUILD indicate 755 permissions now.

Original post:

I've noticed that, at least with plex-media-server and unifi, the permissions stored in the pkg tarball generated by pikaur (my chosen AUR helper) have 750 permissions (instead of the expected 755). I can't figure out why this is happening. Here's the output of the command:

tar -tvf ~/.cache/pikaur/pkg/plex-media-server-1.18.0.1944-1-x86_64.pkg.tar.xz

https://git.eldon.me/trey/pastes/src/br … 4-1.output

Most of the executable files to be placed in /usr/lib/plexmediaserver have -rwxr-x--- (750) permissions, instead of the expected -rwxr-xr-x (755) permissions. I can fix this by issuing the command

sudo chmod o=rx -R /usr/lib/plexmediaserver

or even

sudo chown plex:plex -R /usr/lib/plexmediaserver

...but I'd rather fix it at the source (because the first command will make some files executable when they don't need to be).

Here are my relevant pikaur.conf, /etc/makepkg.conf, and ~/.makepkg.conf:

https://git.eldon.me/trey/pastes/src/br … ikaur.conf
https://git.eldon.me/trey/pastes/src/br … kepkg.conf
https://git.eldon.me/trey/pastes/src/br … kepkg.conf

I don't see where the 750 permissions are coming from, but maybe I'm missing something. This is only happening on one of my Arch hosts, and I use pikaur everywhere I can. I know it's a configuration setting on the affected host, but I can't seem to find out where.

EDIT:  I just upgraded plex-media-server, and there are a lot of messages like this in the output:

warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/clearqam/transponders/
filesystem: 755  package: 750
warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/dvbc/
filesystem: 755  package: 750
warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/dvbc/fast_scan/
filesystem: 755  package: 750
warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/dvbc/transponders/
filesystem: 755  package: 750
warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/dvbs/
filesystem: 755  package: 750
warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/dvbs/transponders/
filesystem: 755  package: 750
warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/dvbt/
filesystem: 755  package: 750
warning: directory permissions differ on /usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/dvbt/transponders/
filesystem: 755  package: 750

So pikaur recognizes the difference between the filesystem and the permissions within the pkg tarball.

EDIT2:  I forgot to mention, my umask is 022, for my regular user and root. Also, in the PKGBUILD there is the command

install -d -m 755 "${pkgdir}/usr/lib/plexmediaserver"

...so I'd expect the permissions to be 755, based on my umask and this install command.

I've already escalated to the maintainers of both `plex-media-server` and `unifi` (which has a similar problem).  Because both packages are exhibiting the same behavior, I thought it was the pikaur and/or makepkg configuration, rather than something within the PKGBUILD files themselves.

Last edited by ectospasm (2019-10-31 02:20:37)

Offline

#2 2019-10-30 13:29:41

loqs
Member
Registered: 2014-03-06
Posts: 9,062

Re: [SOLVED] pikaur and 750 permissions

If you install devtools then build the package with extra-x86_64-build is the issue still present?

Offline

#3 2019-10-30 14:44:23

ectospasm
Member
Registered: 2015-08-28
Posts: 40

Re: [SOLVED] pikaur and 750 permissions

I get some warnings with extra-x86_64-build while PWD=~/.local/share/pikaur/aur_repos/plex-media-server.  It does appear to finish, however.  The resulting pkg tarball has the following output:

tar -tvf plex-media-server-1.18.1.1973-1-x86_64.pkg.tar.xz
-rw-r--r-- root/root      4863 2019-10-30 10:28 .BUILDINFO
-rw-r--r-- root/root       467 2019-10-30 10:28 .INSTALL
-rw-r--r-- root/root    209918 2019-10-30 10:28 .MTREE
-rw-r--r-- root/root       353 2019-10-30 10:28 .PKGINFO
drwxr-xr-x root/root         0 2019-10-30 10:28 etc/
drwxr-xr-x root/root         0 2019-10-30 10:28 etc/conf.d/
-rw-r--r-- root/root       228 2019-10-30 10:28 etc/conf.d/plexmediaserver
drwxr-xr-x root/root         0 2019-10-30 10:28 usr/
drwxr-xr-x root/root         0 2019-10-30 10:28 usr/lib/
drwxr-xr-x root/root         0 2019-10-30 10:28 usr/lib/plexmediaserver/
-rwxr-xr-x root/root   1483320 2019-10-30 10:28 usr/lib/plexmediaserver/CrashUploader
-rwxr-xr-x root/root    415728 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Commercial Skipper
-rwxr-xr-x root/root   4231616 2019-10-30 10:28 usr/lib/plexmediaserver/Plex DLNA Server
-rwxr-xr-x root/root    239752 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Media Fingerprinter
-rwxr-xr-x root/root   6563592 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Media Scanner
-rwxr-xr-x root/root  21958840 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Media Server
-rwxr-xr-x root/root    731408 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Relay
-rwxr-xr-x root/root     12576 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Script Host
-rwxr-xr-x root/root    271440 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Transcoder
-rwxr-xr-x root/root   5565232 2019-10-30 10:28 usr/lib/plexmediaserver/Plex Tuner Service
...

So that looks correct.  I'm not all that familiar with devtools/extra-x86_64-build, it looked like it tried to install the package (but failed because plex-media-server includes a lot of its own versions of a bunch of libraries).

Offline

#4 2019-10-30 15:39:13

loqs
Member
Registered: 2014-03-06
Posts: 9,062

Re: [SOLVED] pikaur and 750 permissions

On this system from the end of  extra-x86_64-build the package installs correctly.

==> Installing package plex-media-server with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) plex-media-server-1.18.1.1973-1

Total Installed Size:  268.40 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
:: Processing package changes...
(1/1) installing plex-media-server                 [######################] 100%
:: Running post-transaction hooks...
(1/4) Creating system user accounts...
Creating group plex with gid 977.
Creating user plex (Plex Media Server) with uid 977 and gid 977.
(2/4) Reloading system manager configuration...
  Skipped: Current root is not booted.
(3/4) Creating temporary files...
(4/4) Arming ConditionNeedsUpdate...
resolving dependencies...
looking for conflicting packages...

Packages (7) elfutils-0.177-1  libnsl-1.2.0-1  licenses-20191011-1
             pyalpm-0.9.0-1  python-3.7.4-2  python-pyelftools-0.25-1
             namcap-3.2.8-3

Total Installed Size:  148.93 MiB

:: Proceed with installation? [Y/n] 
(7/7) checking keys in keyring                     [######################] 100%
(7/7) checking package integrity                   [######################] 100%
(7/7) loading package files                        [######################] 100%
(7/7) checking for file conflicts                  [######################] 100%
:: Processing package changes...
(1/7) installing libnsl                            [######################] 100%
(2/7) installing python                            [######################] 100%
Optional dependencies for python
    python-setuptools
    python-pip
    sqlite [installed]
    mpdecimal: for decimal
    xz: for lzma [installed]
    tk: for tkinter
(3/7) installing pyalpm                            [######################] 100%
(4/7) installing licenses                          [######################] 100%
(5/7) installing elfutils                          [######################] 100%
(6/7) installing python-pyelftools                 [######################] 100%
(7/7) installing namcap                            [######################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

the rest of the output is potential issues namcap detected in the package.
As the permissions generated by extra-x86_64-build are correct it suggests to me the issue is the build environment on your system.
What is the result if you use makepkg directly instead of pikaur?
Edit:
Also is cp an alias on that system?

type -a cp

Last edited by loqs (2019-10-30 15:54:46)

Offline

#5 2019-10-30 20:55:55

ectospasm
Member
Registered: 2015-08-28
Posts: 40

Re: [SOLVED] pikaur and 750 permissions

loqs wrote:

On this system from the end of  extra-x86_64-build the package installs correctly.
...
the rest of the output is potential issues namcap detected in the package.
As the permissions generated by extra-x86_64-build are correct it suggests to me the issue is the build environment on your system.
What is the result if you use makepkg directly instead of pikaur?
Edit:
Also is cp an alias on that system?

type -a cp

If I run

makepkg -f

to force a rebuild of the package, the relevant pkg tarball has the correct permissions:

tar -tvf plex-media-server-1.18.1.1973-1-x86_64.pkg.tar.xz| grep Plex | head -n 10
-rwxr-xr-x root/root    415728 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Commercial Skipper
-rwxr-xr-x root/root   4231616 2019-10-30 16:28 usr/lib/plexmediaserver/Plex DLNA Server
-rwxr-xr-x root/root    239752 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Media Fingerprinter
-rwxr-xr-x root/root   6563592 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Media Scanner
-rwxr-xr-x root/root  21958840 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Media Server
-rwxr-xr-x root/root    731408 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Relay
-rwxr-xr-x root/root     12576 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Script Host
-rwxr-xr-x root/root    271440 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Transcoder
-rwxr-xr-x root/root   5565232 2019-10-30 16:28 usr/lib/plexmediaserver/Plex Tuner Service
drwxr-xr-x root/root         0 2019-10-30 16:28 usr/lib/plexmediaserver/Resources/Plug-ins-0f4abfbcc/PlexMovie.bundle/

So it's not with makepkg, but something with my pikaur environment.  Oh, and the output of `type -a cp`:

type -a cp
cp is /usr/bin/cp
cp is /bin/cp
cp is /sbin/cp
cp is /usr/sbin/cp

So no aliases, and the first cp found in my PATH (`which cp`) is /usr/bin/cp.  I haven't posted an issue upstream (GitHub).  I suppose that's my next step.

Offline

#6 2019-10-30 21:28:22

loqs
Member
Registered: 2014-03-06
Posts: 9,062

Re: [SOLVED] pikaur and 750 permissions

I am not familiar with pikaur.
diff of PKGBUILD adding check umask and stat of Resources/Tuner/Shared/scanners/clearqam/transponders/ in prepare() and pakage()

diff --git a/PKGBUILD b/PKGBUILD
index 508e7ca..56e3cf3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,12 +41,15 @@ sha256sums_armv7h=('339ac2874fb9aedc01db7864568152b082ecb1d6bc620ba6a2c194caffc3
 sha256sums_aarch64=('edbd853118ee32c382b1cfbc9f6467f4cdb90306781ce2f9c4a48d371872cf0a')
 
 prepare() {
+  umask
+  stat usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/clearqam/transponders/
   if [[ $CARCH = armv7h ]] || [[ $CARCH = aarch64 ]]; then
     bsdtar -xf data.tar.xz
   fi
 }
 
 package() {
+  umask
   install -d -m 755 "${pkgdir}/usr/lib/plexmediaserver"
   cp -dr --no-preserve='ownership' "${srcdir}/usr/lib/plexmediaserver" "${pkgdir}/usr/lib/"
 
@@ -56,6 +59,7 @@ package() {
   install -D -m 644 "${srcdir}/plex.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/plex.conf"
 
   install -D -m 644 "${srcdir}/terms.txt" "${pkgdir}/usr/share/licenses/${pkgname}/terms.txt"
+  stat "$pkgdir"/usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/clearqam/transponders/
 }
 
 # vim: ts=2 sw=2 et:

Offline

#7 2019-10-30 21:36:38

ectospasm
Member
Registered: 2015-08-28
Posts: 40

Re: [SOLVED] pikaur and 750 permissions

I've escalated the issue upstream:  https://github.com/actionless/pikaur/issues/416

If they end up providing a solution I will copy it here.

Offline

#8 2019-10-30 21:53:56

ectospasm
Member
Registered: 2015-08-28
Posts: 40

Re: [SOLVED] pikaur and 750 permissions

loqs wrote:

I am not familiar with pikaur.
diff of PKGBUILD adding check umask and stat of Resources/Tuner/Shared/scanners/clearqam/transponders/ in prepare() and pakage()

diff --git a/PKGBUILD b/PKGBUILD
index 508e7ca..56e3cf3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,12 +41,15 @@ sha256sums_armv7h=('339ac2874fb9aedc01db7864568152b082ecb1d6bc620ba6a2c194caffc3
 sha256sums_aarch64=('edbd853118ee32c382b1cfbc9f6467f4cdb90306781ce2f9c4a48d371872cf0a')
 
 prepare() {
+  umask
+  stat usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/clearqam/transponders/
   if [[ $CARCH = armv7h ]] || [[ $CARCH = aarch64 ]]; then
     bsdtar -xf data.tar.xz
   fi
 }
 diff --git a/PKGBUILD b/PKGBUILD
index 508e7ca..56e3cf3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,12 +41,15 @@ sha256sums_armv7h=('339ac2874fb9aedc01db7864568152b082ecb1d6bc620ba6a2c194caffc3
 sha256sums_aarch
 package() {
+  umask
   install -d -m 755 "${pkgdir}/usr/lib/plexmediaserver"
   cp -dr --no-preserve='ownership' "${srcdir}/usr/lib/plexmediaserver" "${pkgdir}/usr/lib/"
 
@@ -56,6 +59,7 @@ package() {
   install -D -m 644 "${srcdir}/plex.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/plex.conf"
 
   install -D -m 644 "${srcdir}/terms.txt" "${pkgdir}/usr/share/licenses/${pkgname}/terms.txt"
+  stat "$pkgdir"/usr/lib/plexmediaserver/Resources/Tuner/Shared/scanners/clearqam/transponders/
 }
 
 # vim: ts=2 sw=2 et:

I added umask and stat to prepare(): 

0022
  File: usr/lib/plexmediaserver/Plex Media Server
  Size: 21958840        Blocks: 42904      IO Block: 8192   regular file
Device: 34h/52d Inode: 360863207   Links: 1
Access: (0750/-rwxr-x---)  Uid: ( 1000/    trey)   Gid: ( 1000/    trey)
Access: 2019-10-30 17:45:09.000000000 -0400
Modify: 2019-10-17 05:38:40.000000000 -0400
Change: 2019-10-30 17:45:10.000000000 -0400
 Birth: -

And package(): 

0022
  File: /nasty/backup/osmium/pikaur/build/plex-media-server/pkg/plex-media-server/usr/lib/plexmediaserver/Plex Media Server
  Size: 21958840        Blocks: 42904      IO Block: 8192   regular file
Device: 34h/52d Inode: 360862799   Links: 1
Access: (0750/-rwxr-x---)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 1970-01-01 19:32:47.000000000 -0500
Modify: 2019-10-30 17:45:52.124839782 -0400
Change: 2019-10-30 17:45:52.000000000 -0400
 Birth: -

So at this point my guess is that it has those permissions when the rpm is unpacked.  Even though the `install` command in the PKGBUILD indicates 755 permissions.  Honestly, I do not install plex-media-server or unifi on anything but this one target host (hostname osmium).  It just seems strange that two packages would exhibit the same behavior.

I'll see what upstream has to say.

Offline

#9 2019-10-30 22:06:32

loqs
Member
Registered: 2014-03-06
Posts: 9,062

Re: [SOLVED] pikaur and 750 permissions

Agreed looks as though the issue is in the source extraction or setup of the $src directory.

  install -d -m 755 "${pkgdir}/usr/lib/plexmediaserver"

Creates the plexmediaserver directory

  cp -dr --no-preserve='ownership' "${srcdir}/usr/lib/plexmediaserver" "${pkgdir}/usr/lib/"

The directories contents and attributes (ownership and permissions) come from the cp command.
If mode was added to the --no-preserve option as in

  cp -dr --no-preserve='ownership,mode' "${srcdir}/usr/lib/plexmediaserver" "${pkgdir}/usr/lib/"

then the mode would be set by umask but as you mentioned in your original post that has the same issue as recursive chmod.

Offline

#10 2019-10-31 02:21:28

ectospasm
Member
Registered: 2015-08-28
Posts: 40

Re: [SOLVED] pikaur and 750 permissions

[SOLVED] Due to the disk space requirements of mongodb (needs nearly 200G in default configuration), the ~/.cache/pikaur directory was a symlink to an NFS share with more capacity.  The interaction of that absolute path was causing the permissions to be 750.  I'm not 100 percent clear on why that was the case, but now that I'm using mongodb-bin, I don't need the symlink any longer.  Removing that symlink caused pikaur to create a new directory in its place, and the `stat` commands I placed into the plex-media-server PKGBUILD indicate 755 permissions now.

I've edited my original post to reflect the above, so someone doesn't need to scroll through the whole history to find the solution.

Last edited by ectospasm (2019-10-31 02:22:44)

Offline

Board footer

Powered by FluxBB