View Single Post

   
  #6 (permalink)  
Old 02-19-2008, 08:19 PM
Olive
 
Posts: n/a
Default Re: being a normal user to build package

Joost Kremers wrote:

> Olive wrote:
>> Something that I do like in Slackware is that the build scripts to
>> generate

>
> s/do/don't/
>
>> Slackware packages assume that they will be run as root. Moreover the
>> tool buildpkg does not allow to set the correct owner of the files in a
>> package

>
> s/buildpkg/makepkg/ i assume?
>
>> without doing a chown on the to-be-packaged directory (which requires to
>> be root);

>
> no, it's not makepkg that doesn't allow you to do this, it's linux that
> doesn't allow you to do this. it'd be a great thing if every user could
> create a file and then change ownership of it to root. /not/.
>
>> This approach contradicts the philosophy of never being root when you do
>> not really need to.

>
> no, it doesn't, because you really *do* need to be root in order to make a
> package that has to be installed system-wide. why? because tar retains
> ownership and permissions of files. if you were to create a package as
> user and then install it as root system-wide, the files *and* the
> directories in the package would obtain ownership and permissions of the
> user that created the package.
>
> now, note that if a tar ball (and therefore also in a slackware package)
> contains a file /usr/bin/someprog, it will also list the directories /usr
> and /usr/bin. so if you were to install a package that was created by a
> user system-wide, the directories /usr and /usr/bin would get ownership of
> the user. as a result, those directories would be *writable* for that
> user. which is not what you want.
>
>> That's said, Slackware is still my preferred distro; but that does not
>> prevent me to point out some negative points ...

>
> well, i hope i have convinced you that it is not a negative point, but
> that it is inevitable to do it this way: a package that's to be installed
> system-wide must be created as root, because its directories and files
> must be owned by root.
>


The answer of Suart Winter shows precisely that such thing is possible with
the provided Slackware scripts and I thank him very much for the info!

You mistake the fact that the kernel does not allow to change the ownership
of a file (which is expected) and the possibility for a normal user to
create a tar archive where the files has whatever owner recorded. Tar does
indeed support to reset all ownership to the desired values (with the
--group and --owner option) in a limited way.

--
Olive

Reply With Quote