You are not logged in.

#1 2005-04-16 04:12:43

nuopus
Member
From: Mesa, AZ
Registered: 2005-03-09
Posts: 60

Pacman package can change permissions of existing dirs?

Hello ... I have a question. I am creating a PKGBUILD to simplify the installation/update of LimeWire professional ... a piece of software I purchased ... and I found something wierd.

The package I download from the limewire site is an rpm. in my pkgbuild I do:

rpmunpack LimeWireLinux.rpm
gunzip < LimeWireLinux.cpio.gz | cpio -ivd
cp -a $startdir/src/usr $startdir/pkg

It unpacks the RPM into a usr directory that is then copied to pkg. I didnt think there was anything wrong until something horrible happened. The usr directory that was unpacked from the rpm using rpmunpack and cpio was set with permission 700 along with several directories inside of it.

When I install the built package with pacman -A it unpacks everything where it is supposed to ... but it ALSO changes the permission of /usr and several subdirs to 700 making it so nobody can access software.

I decided I would use rpm2targz instead of rpmunpack and cpio and changed. It unpacks to usr with permission 755 which is more normal. After installing the NEW package it changes the permission to 755.


Should a package you install be allowed to just change permissions of an existing subdirectory like usr like that? Wouldnt this open the system up to havoc by someone creating a PKGBUILD simply to botch up permissions and post it to AUR?

Also ... since rpm2targz did a MUCH better job ... is it possible to add it to current or extra?

Offline

#2 2005-04-16 06:18:11

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Pacman package can change permissions of existing dirs?

there is another thread about being educated about what pkgbuilds/packages you allow on your system. That is beyond the scope of pacman itself...
As for setting/changing permissions, packages install as root, and the root user does have such permissions. You just have to make sure you build your package correctly.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-04-16 15:13:06

nuopus
Member
From: Mesa, AZ
Registered: 2005-03-09
Posts: 60

Re: Pacman package can change permissions of existing dirs?

cactus wrote:

there is another thread about being educated about what pkgbuilds/packages you allow on your system. That is beyond the scope of pacman itself...
As for setting/changing permissions, packages install as root, and the root user does have such permissions. You just have to make sure you build your package correctly.

Okay. So I guess my next question would be the correct method of extracting files from an RPM. Extracting the rpm using rpmunpack blah.rpm && gunzip < blah.rpm.cpio.gz | cpio -ivd results in a usr directory that is accessible only to owner. rpm2targz results in a usr that is more normal ... but packaging guidelines of AUR say that dependencies should only include programs in the regular repositories and rpm2targz is not in there ... it is in one of the TURs.

Not saying I am going to post limewire pro ... that is for my personal use only. I just want to know for future knowledge when I make a PKGBUILD from an RPM distributed program.

Offline

#4 2005-04-16 17:59:10

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Pacman package can change permissions of existing dirs?

I would use "install" instead of copy...

install -m755 $startdir/src/usr $startdir/pkg/

Offline

#5 2005-04-16 20:46:26

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Pacman package can change permissions of existing dirs?

yup. phrakture got it. Unpack to the src dir in the pkgbuild, then use install to install it to the pkg dir.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB