openbsd-ports/net/smokeping/patches/patch-bin_smokeping_dist
2008-11-12 12:49:42 +00:00

25 lines
738 B
Plaintext

$OpenBSD: patch-bin_smokeping_dist,v 1.9 2008/11/12 12:49:42 sthen Exp $
--- bin/smokeping.dist.orig Sat Apr 26 14:02:18 2008
+++ bin/smokeping.dist Wed Nov 12 10:24:56 2008
@@ -1,5 +1,4 @@
-#!/usr/sepp/bin/perl-5.8.4 -w
+#!/usr/bin/perl -w
# -*-perl-*-
-use lib qw(/usr/pack/rrdtool-1.2.23-mo/lib/perl);
use lib qw(lib);
@@ -8,6 +7,12 @@
+
+use POSIX qw(setuid setgid getpwnam);
+print "Dropping privileges to _smokeping ...\n";
+my (undef, undef, $uid, $gid) = POSIX::getpwnam("_smokeping");
+POSIX::setgid($uid) or die "setgid() to $gid failed, abort\n";
+POSIX::setuid($uid) or die "setuid() to $uid failed, abort\n";
-Smokeping::main("etc/config.dist");
+Smokeping::main("%%SYSCONFDIR%%/smokeping/config");
=head1 NAME