Code

Save exit_value from subshell correct with newer perl versions.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Aug 2009 09:33:22 +0000 (09:33 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Aug 2009 09:33:22 +0000 (09:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14150 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/modules/GosaSupportDaemon.pm

index 566ba0e5726d63c78360b892847aecdf9b1bef3e..b3a43167718f6a03a631abf084648b2af918c64e 100644 (file)
@@ -758,9 +758,11 @@ sub run_as {
        }
        my $cmd_line= "$sudo_cmd su - $uid -c '$command'";
        open(PIPE, "$cmd_line |");
-       my $result = {'resultCode' => $?};
-       $result->{'command'} = $cmd_line;
+       my $result = {'command' => $cmd_line};
        push @{$result->{'output'}}, <PIPE>;
+       close(PIPE);
+       my $exit_value = $? >> 8;
+       $result->{'resultCode'} = $exit_value;
        return $result;
 }