[Nagiosplug-devel] setuid plugin handling

Ton Voon ton.voon at altinity.com
Thu Dec 7 12:41:36 CET 2006


Hi Gavin,

On 7 Dec 2006, at 05:22, Gavin Carr wrote:

> I just noticed that check_dhcp and check_icmp are missing from the  
> rpmforge
> nagios-plugins package. Turns out this is because of this change in  
> 1.4.3:
>
>   Setuid plugins (check_dhcp, check_icmp) separated into plugins- 
> root/.
>   Run make install as root to install
>
> Since packagers don't like to run things as root, these two (at  
> least) were
> omitted.
>
> Can we change this behaviour to make setuid plugins always install,  
> and then
> make them setuid if we're installing as root? Making the binaries  
> setuid at
> make install time is definitely optional - it can be done by the  
> packaging
> system, or they could even be installed non-setuid and called by  
> sudo, for
> instance.

When I made this change, I was copying coreutils' behaviour with su  
(I get a lot of inspiration from their project!). They put a warning  
up if make install is run without root. A make install-root will  
install and setuid.

If make install-root is run without root, then the chmod u+s will  
fail, but the executable will still be available and the makefile  
considers it a success. Then via post-processing or some permissions  
specified in a spec file, you can add the correct permissions on a  
package install.

So I would recommend for packaging that you use fakeroot or run make  
install, followed by make install-root.

However, you are the second person to ask about this, so it is not  
obvious. If there is a clamour to change it, we can amend the behaviour.

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20061207/d7643144/attachment.html>


More information about the Devel mailing list