diff options
author | Urban Müller | 2019-09-24 14:56:16 +0200 |
---|---|---|
committer | Urban Müller | 2019-09-24 14:56:16 +0200 |
commit | 784642327bfb0d3456ce94257c4108f6b577f99a (patch) | |
tree | f7be7a5a7d69677207fb5d9bd81e758289c531c8 | |
parent | e04f87ccc76faaf1115601185d254f1694e438a7 (diff) | |
download | itools-784642327bfb0d3456ce94257c4108f6b577f99a.tar.gz itools-784642327bfb0d3456ce94257c4108f6b577f99a.tar.bz2 itools-784642327bfb0d3456ce94257c4108f6b577f99a.zip |
use effective uid, avoid it::exec
-rw-r--r-- | it.class | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -290,7 +290,10 @@ static function error($p = array()) if (!it::is_live() || array_diff($debugparams, it::match('[-\w]+', $GLOBALS['ULTRAHOME'], ['all' => true]), ["devel", "twin", "utf8check", gethostname()])) $type = mb_strtolower($type); - $from = trim(it::exec('echo \"$USER@`hostname`\" "<$USER@`dnsdomainname | grep . || hostname -f`>"')); + $hostname = gethostname(); + $user = posix_getpwuid(posix_geteuid())['name']; + $from = "\"$user@$hostname\" <$user@" . gethostbyaddr(gethostbyname($hostname)) .">"; + it::mail(['From' => $from, 'To' => $p['to'], 'Subject' => $type . substr($p['title'], 0, 160), 'Body' => $body, 'Cc' => $GLOBALS['it_defaultconfig']['error_cc'], 'forcemail' => !it::is_devel()]); $p['title'] = "Mail: " . $p['title']; } |