diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-11-14 15:53:44 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-11-14 15:54:05 -0200 |
commit | 2b41df9c4d62c44e58d1acf25153a8216959636f (patch) | |
tree | 257f5bac6cfad32df9b7ede515a35c686d7093a3 /etc | |
parent | 0f84dee3eb08752e0aba1412d5fb0ec2632b07c3 (diff) | |
download | pfsense-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.inc | 5 |
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)); |