diff options
author | Ky-Anh Huynh <kyanh@theslinux.org> | 2013-11-13 06:29:53 +0700 |
---|---|---|
committer | Ky-Anh Huynh <kyanh@theslinux.org> | 2013-11-13 06:29:53 +0700 |
commit | c6b156bfa537754d079868653ef3561eb1330d8c (patch) | |
tree | 720c78f1fb0455f083fb3e7e059c388c6350e3ff /etc/inc/auth.inc | |
parent | f70121be366f41c6099e864c1fbebbd96aaae3cf (diff) | |
download | pfsense-c6b156bfa537754d079868653ef3561eb1330d8c.zip pfsense-c6b156bfa537754d079868653ef3561eb1330d8c.tar.gz |
local_sync_accounts: provides empty STDIN to pw userdel command
The /usr/sbin/pw command may wait for user input. For example,
if there is a manual crontab settings for :foobar account, then
when this account is requested to be deleted, the command will
ask if user wants to delete crontab settings for the account.
Because the command waits for user input, the boot process will
hang at the "Synchronizing user settings..." step, unless user
presses any key.
To avoid this problem, we use the /bin/echo command to give
empty input for /usr/bin/pw command. This is an alternative of
typing "no" or "n".
This is a not the best way. Maybe closing STDIN is good. Or
force users to change account settings from webUI.
See also #852 (pull request). Renato Botelho points out that
"pw userdel" will call "crontab -u %user -r" that is interative.
"pw groupdel" will never be interative, though.
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r-- | etc/inc/auth.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 67fd8b1..0ea2c00 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -329,7 +329,7 @@ function local_sync_accounts() { $line = explode(":",fgets($fd)); if (((!strncmp($line[0], "_", 1)) || ($line[2] < 2000) || ($line[2] > 65000)) && ($line[0] != "admin")) continue; - $cmd = "/usr/sbin/pw userdel -n '{$line[0]}'"; + $cmd = "/bin/echo | /usr/sbin/pw userdel -n '{$line[0]}'"; if($debug) log_error(sprintf(gettext("Running: %s"), $cmd)); mwexec($cmd); |