|
@@ 383-392 (lines=10) @@
|
| 380 |
|
$flushCache = true; |
| 381 |
|
} |
| 382 |
|
|
| 383 |
|
if (isset(Daemon::$config->group->value)) { |
| 384 |
|
if ($sg === false) { |
| 385 |
|
Daemon::log('Couldn\'t change group to \'' . Daemon::$config->group->value . '\'. You must replace config-variable \'group\' with existing group.'); |
| 386 |
|
exit(0); |
| 387 |
|
} elseif (($sg['gid'] != posix_getgid()) && (!posix_setgid($sg['gid']))) { |
| 388 |
|
Daemon::log('Couldn\'t change group to \'' . Daemon::$config->group->value . "'. Error (" . ($errno = posix_get_last_error()) . '): ' . posix_strerror($errno)); |
| 389 |
|
exit(0); |
| 390 |
|
} |
| 391 |
|
$flushCache = true; |
| 392 |
|
} |
| 393 |
|
|
| 394 |
|
if (isset(Daemon::$config->user->value)) { |
| 395 |
|
if ($su === false) { |
|
@@ 394-403 (lines=10) @@
|
| 391 |
|
$flushCache = true; |
| 392 |
|
} |
| 393 |
|
|
| 394 |
|
if (isset(Daemon::$config->user->value)) { |
| 395 |
|
if ($su === false) { |
| 396 |
|
Daemon::log('Couldn\'t change user to \'' . Daemon::$config->user->value . '\', user not found. You must replace config-variable \'user\' with existing username.'); |
| 397 |
|
exit(0); |
| 398 |
|
} elseif ($su['uid'] != posix_getuid() & !posix_setuid($su['uid'])) { |
| 399 |
|
Daemon::log('Couldn\'t change user to \'' . Daemon::$config->user->value . "'. Error (" . ($errno = posix_get_last_error()) . '): ' . posix_strerror($errno)); |
| 400 |
|
exit(0); |
| 401 |
|
} |
| 402 |
|
$flushCache = true; |
| 403 |
|
} |
| 404 |
|
if ($flushCache) { |
| 405 |
|
clearstatcache(true); |
| 406 |
|
} |