From d84076404b64a2738298db86adb8aef9035f5629 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 3 Jul 2012 16:35:21 -0400 Subject: Ensure havp user and group exist --- config/havp/havp.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config/havp') 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 -- cgit v1.2.3