Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: dimgel on 14 July 2022, 15:59:54

Title: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter
Post by: dimgel on 14 July 2022, 15:59:54
Hi all. Not something serious I hope, just curious.

Code: [Select]
# pacman -Qkk
warning: libutempter: /usr/lib/utempter/utempter (Permissions mismatch)
...
# ls -l /usr/lib/utempter/utempter
-rwxr-sr-x 1 root utmp 14168 2022-06-15 03:15:15 /usr/lib/utempter/utempter

libutempter-1.2.1-3-x86_64.pkg.tar.zst/.MTREE:
Code: [Select]
...
/set type=file uid=0 gid=0 mode=644
...
./usr/lib/utempter/utempter time=1655252115.0 mode=2711 size=14168 md5digest=... sha256digest=...
...

So according to .MTREE this file should: (1) belong to root:root instead of root:utmp; (2) have permissions rwx--s--x instead of rwx-r-sr-x.

I didn't find any post-install hooks in package `libutempter 1.2.1-3` itself. I also tried to delete this file and run `pacman -S --asdep libutempter`, which changed nothing.

So I wonder how does it happen that ownership and permissions of this file change?
Title: Re: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter
Post by: vaapicon on 15 July 2022, 06:35:22
Its in the PKGBUILD file.

Code: [Select]
package() {                                                                     
  cd $pkgname-$pkgver                                                          
  make DESTDIR="$pkgdir" install                                               
  echo 'z /usr/lib/utempter/utempter 2755 root utmp' | install -Dm644 /dev/stdin "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"                                    
}
Title: Re: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter
Post by: vaapicon on 15 July 2022, 07:53:05
More specifically pacman does this with the tmpfiles hook.

libutempter.conf
Code: [Select]
z /usr/lib/utempter/utempter 2755 root utmp

excerpt from the "tmpfiles" man page
Quote
Files and directories
marked with z, Z, t, T, a, and A have their ownership,
access mode and security labels set.
Title: Re: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter
Post by: dimgel on 15 July 2022, 09:24:36

I don't see this file in /var/cache/pacman/pkg/libutempter-1.2.1-3-x86_64.pkg.tar.zst. :( Where is it?

More specifically pacman does this with the tmpfiles hook.

Ok, found it in archive in /usr/lib/tmpfiles.d/libutempter.conf. My yesterday's eyes. :/ Thank you. :)