]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/template/inspircd
Relax fd bounds checking
[user/henk/code/inspircd.git] / make / template / inspircd
index 88eb7ee6a81e8fb940b5b72fc43ff312296123e7..7610557b8dac70851eac0e48d2ae478a151f8369 100644 (file)
@@ -1,3 +1,4 @@
+%mode 0750
 #!/usr/bin/env perl
 
 #
@@ -26,13 +27,14 @@ use Fcntl;
 my $basepath   =       "@BASE_DIR@";
 my $confpath   =       "@CONFIG_DIR@/";
 my $binpath    =       "@BINARY_DIR@";
-my $runpath    =       "@DATA_DIR@";
+my $runpath    =       "@BASE_DIR@";
+my $datadir    =       "@DATA_DIR@";
 my $valgrindlogpath    =       "$basepath/valgrindlogs";
-my $executable =       "@EXECUTABLE@";
-my $version    =       "@VERSION@";
+my $executable =       "inspircd";
+my $version    =       "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@+@VERSION_LABEL@";
 my $uid = "@UID@";
 
-if ($< == 0 || $> == 0) {
+if (!("--runasroot" ~~ @ARGV) && ($< == 0 || $> == 0)) {
        if ($uid !~ /^\d+$/) {
                # Named UID, look it up
                $uid = getpwnam $uid;
@@ -382,7 +384,7 @@ sub getpidfile
        }
 
        # End of includes / No includes found. Using default.
-       $pidfile = $runpath . "/inspircd.pid";
+       $pidfile = $datadir . "/inspircd.pid";
 }
 
 sub getstatus {