diff options
author | jim-p <jimp@pfsense.org> | 2012-07-03 16:35:21 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-07-03 16:35:21 -0400 |
commit | d84076404b64a2738298db86adb8aef9035f5629 (patch) | |
tree | 95a1aca01fe1a2030830b4ff6d1c3eefce10bb5d /config/havp | |
parent | 7ae20133d529a9173e6fb7d871d56b0ec9a7856c (diff) | |
download | pfsense-packages-d84076404b64a2738298db86adb8aef9035f5629.tar.gz pfsense-packages-d84076404b64a2738298db86adb8aef9035f5629.tar.bz2 pfsense-packages-d84076404b64a2738298db86adb8aef9035f5629.zip |
Ensure havp user and group exist
Diffstat (limited to 'config/havp')
-rw-r--r-- | config/havp/havp.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config/havp/havp.inc b/config/havp/havp.inc index cd8e9d4f..51f3f11e 100644 --- a/config/havp/havp.inc +++ b/config/havp/havp.inc @@ -380,7 +380,12 @@ function havp_check_system() $grp = exec('pw group show ' . HVDEF_GROUP); if (strpos($grp, HVDEF_GROUP) !== 0) { exec('pw group add ' . HVDEF_GROUP); - log_error("Antivirus: Username '" . HVDEF_GROUP . "' was added."); + log_error("Antivirus: Group '" . HVDEF_GROUP . "' was added."); + } + $usr = exec('pw usershow -n ' . HVDEF_USER); + if (strpos($usr, HVDEF_USER) !== 0) { + exec('pw useradd ' . HVDEF_USER . ' -g ' . HVDEF_GROUP . ' -h - -s "/sbin/nologin" -d "/nonexistent" -c "havp daemon"'); + log_error("Antivirus: User '" . HVDEF_USER . "' was added."); } # workdir permissions |