Skip to content
Permalink
Browse files

Deny non-root user running nems-mailtest

  • Loading branch information...
NEMS Linux
NEMS Linux committed Apr 12, 2019
1 parent 7150888 commit c3fde7b0311472b8664db0393b796191fccd7c62
Showing with 4 additions and 0 deletions.
  1. +4 −0 mailtest.sh
@@ -45,6 +45,10 @@
*/
$user=trim(shell_exec('whoami'));
if ($user != 'root') die('You cannot run this program as ' . $user . '. Please use sudo.' . PHP_EOL);
$CONTACTEMAIL=@trim(@$argv[1]);
if (!filter_var($CONTACTEMAIL, FILTER_VALIDATE_EMAIL)) {
echo 'Usage: ./mailtest.sh youremail@yourdomain.com' . PHP_EOL;

0 comments on commit c3fde7b

Please sign in to comment.
You can’t perform that action at this time.