Commit cd2335a4 authored by Clément Démoulins's avatar Clément Démoulins
Browse files

Remove sudo

parent 0a8ca2b6
......@@ -175,7 +175,7 @@ SCRIPT;
global $ld_library_path;
// Build command line.
$cmd = "sudo -u webapp LD_LIBRARY_PATH=$ld_library_path $bin $args";
$cmd = "LD_LIBRARY_PATH=$ld_library_path $bin $args";
// System call to run the program.
$output = "";
......@@ -189,4 +189,4 @@ SCRIPT;
return $retval;
}
};
\ No newline at end of file
};
......@@ -9,16 +9,16 @@ function run()
{
check_file_validity();
$tmpfile = get_tmp_filename();
$tmpfile = get_tmp_filename();
$input = get_uploaded_file();
copy($input, $tmpfile."_tmp");
exec("sudo -u webapp convert {$tmpfile}_tmp {$tmpfile}_orig.png", $trash, $retval);
exec("convert {$tmpfile}_tmp {$tmpfile}_orig.png", $trash, $retval);
handle_errors($retval);
exec("sudo -u webapp /home/lazzara/bin/show_through {$tmpfile}_orig.png 15000 32 ${tmpfile}_fg ${tmpfile}_bg", $output, $retval);
exec("/home/lazzara/bin/show_through {$tmpfile}_orig.png 15000 32 ${tmpfile}_fg ${tmpfile}_bg", $output, $retval);
handle_errors($retval);
exec("sudo -u webapp convert ${tmpfile}_fg $tmpfile.png", $trash, $retval);
exec("sudo -u webapp convert ${tmpfile}_bg ${tmpfile}_orig.png", $trash, $retval);
exec("convert ${tmpfile}_fg $tmpfile.png", $trash, $retval);
exec("convert ${tmpfile}_bg ${tmpfile}_orig.png", $trash, $retval);
handle_errors($retval);
display_image_result($output);
......@@ -28,7 +28,7 @@ function run()
if(is_file($tmpfile_bg))
unlink("{$tmpfile}_bg");
// exec("sudo -u webapp rm ${tmpfile}_bg ${tmpfile}_fg");
/* exec("rm ${tmpfile}_bg ${tmpfile}_fg"); */
if(is_file("{$tmpfile}_tmp"))
unlink("{$tmpfile}_tmp");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment