Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter (Read 499 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter

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?

 

Re: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter

Reply #1
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"                                    
}

Re: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter

Reply #2
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.

Re: pacman -Qkk reports wrong permissions on /usr/lib/utempter/utempter

Reply #3

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. :)