summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-11-14 15:53:44 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-11-14 15:54:05 -0200
commit2b41df9c4d62c44e58d1acf25153a8216959636f (patch)
tree257f5bac6cfad32df9b7ede515a35c686d7093a3 /etc
parent0f84dee3eb08752e0aba1412d5fb0ec2632b07c3 (diff)
downloadpfsense-2b41df9c4d62c44e58d1acf25153a8216959636f.zip
pfsense-2b41df9c4d62c44e58d1acf25153a8216959636f.tar.gz
Provide a more safe way to avoid pw userdel being interactive because of a crontab existance
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/auth.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 67fd8b1..521656b 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -329,6 +329,11 @@ function local_sync_accounts() {
$line = explode(":",fgets($fd));
if (((!strncmp($line[0], "_", 1)) || ($line[2] < 2000) || ($line[2] > 65000)) && ($line[0] != "admin"))
continue;
+ /*
+ * If a crontab was created to user, pw userdel will be interactive and
+ * can cause issues. Just remove crontab before run it when necessary
+ */
+ unlink_if_exists("/var/cron/tabs/{$line[0]}");
$cmd = "/usr/sbin/pw userdel -n '{$line[0]}'";
if($debug)
log_error(sprintf(gettext("Running: %s"), $cmd));
OpenPOWER on IntegriCloud