Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#55295 - [netctl] Limit use cases of wifi-menu when filenames contain spaces or SSID is nil

Attached to Project: Arch Linux
Opened by Michaël Cadilhac (cadilhac) - Saturday, 26 August 2017, 09:35 GMT
Last edited by Jouke Witteveen (jouke) - Tuesday, 10 October 2017, 16:00 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Two use cases of wifi-menu with "extreme" SSIDs fail: when an empty SSID exists and there's no active connection, and when an SSID with trailing space has had a created profile. A potential patch is attached.

Additional info:
* netctl 1.13-2


Steps to reproduce:
1. Have a router with an empty SSID. If no connection is currently activated, wifi-menu will wrongly report that I'm connected to the empty SSID.
2. Create (with wifi-menu for instance) a profile for an SSID with a trailing space. Then wifi-menu is unable to relist it afterwards, since the trailing space is lost at some point.

This task depends upon

Closed by  Jouke Witteveen (jouke)
Tuesday, 10 October 2017, 16:00 GMT
Reason for closing:  Fixed
Additional comments about closing:  4d18e145 improves handling of leading/trailing whitespace
Comment by Jouke Witteveen (jouke) - Sunday, 27 August 2017, 08:40 GMT
Thanks for your report and the patch!

The first case was already covered by
https://git.archlinux.org/netctl.git/commit/?id=1da7ed2939d806191f1e20c8e451417314165b69
which will be part of the next release.

As for the second case, I noted that there are a few more instance of `while read -r profile` in netctl. Maybe it is better to trim the whitespace in create_profile and add the requirement that profile files contain no leading or trailing whitespace?
Comment by Michaël Cadilhac (cadilhac) - Sunday, 27 August 2017, 09:10 GMT
Hi there Jouke! Well, your call really; both have some kind of advantages. Setting the IFS is a way to make (quasi) sure that we're not missing cases (e.g., leading front space, although a quite unlikely thing). I believe that TRTTD would be to have list_profile use -print0 and all its uses rely on "read -d $'\0'" (or, in the case of "network", "mapfile -d $'\0'"). This would be the safest option.

M.
Comment by Jouke Witteveen (jouke) - Monday, 28 August 2017, 07:03 GMT
Using $'\0' as a separator would be the right thing to do theoretically. From a developer perspective it would make life harder, however. That is why in the netctl source we assume that profile names do not contain newline characters and we use that as a separator. This makes the code cleaner and makes it possible to include a profile name in lines of input/output.

I am away for a few weeks and will choose either to improve handling of leading/trailing spaces, or to forbid them and replace them in profile files generated by wifi-menu. If you can think of any reason why one approach is better (for either the user or the developer) than the other, let me know!

Loading...