Assume you can install something on a system because you have
sudo rights to do so, but only have
sudo rights for the installer. In that case it is fairly easy to create a package that installs a binary owned by root that has the setuid bit set during installation, and have that binary execute any command that you feed it, as root. This makes it insecure to allow limited sudo access for any given user to a package that can arbitrarily change change permissions. The other obvious (IMO) security hole is that a package can update the
/etc/sudoers file and grant the user all kind of additional rights.
As far as I know
yum have an option that you can set, or check how they are invoked, that causes what is installed in the normal, default, locations, but in a limited way (e.g. not overwriting already available files, or not setting setuid bits).
Did I miss something and does installation with such restrictions exists? Is it available in other installers? Or are there other known workarounds that would make such restrictions ineffective (and implementing them a waste of time)?