/usr/bin/gufw: line 2: [: too many arguments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gufw |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
LANGUAGE=C gufw
/usr/bin/gufw: line 2: [: too many arguments
shellcheck report missing quotes (SC2046) on line 2 and 6 (SC2086).
In line 2, the script assumes that loginctl will return only one session per user.
In my test, loginctl sometimes reported several sessions for the current user.
loginctl|grep $(whoami)
c11 1001 johnsmith
c12 1000 smith seat0
c2 1000 smith seat0
c5 1000 smith seat0
This can be fixed by checking that the session is active.
Also, the script does not correctly filter on the current user, for example, with user smith and johnsmith both having a session and smith trying to log in.
The attached file fixes theses issues. It has been checked with shellcheck.
Changed in gui-ufw: | |
status: | New → Fix Released |
See the attached ShellCheck report for the original script.