fix ownership and permissions of the cgi-script and its parent dirs during installation foerste
authorMatthias Förste <foerste@schlittermann.de>
Fri, 15 Jul 2011 15:39:28 +0200
branchfoerste
changeset 27 ea93837d0821
parent 26 9edb61423498
child 28 9d0a1a1b70a7
fix ownership and permissions of the cgi-script and its parent dirs during installation
Build.PL
--- a/Build.PL	Fri Jul 15 14:22:21 2011 +0200
+++ b/Build.PL	Fri Jul 15 15:39:28 2011 +0200
@@ -24,6 +24,16 @@
         print $c 'Depends: ', join ', ', map { "$_$deps{$_}" } keys %deps;
         system('equivs-build', $c->filename);
     }
+    sub ACTION_install {
+        my $self = shift;
+        my $h = ($self->install_path('cgi-bin') =~ m|^(.*)/cgi-bin$|)[0] ;
+        my $u = my $g = ($h =~ m|/([^/]+)$|)[0];
+        system(qw(chown -R), "$u:$g", $h) == 0
+            or die "Can't 'chown -R $u:$g $h': $!";
+        system(qw(chmod -R go=,-st), $h) == 0
+            or die "Can't 'chmod -R go=,-st $h";
+        $self->SUPER::ACTION_install;
+    }
 ___CODE
 );