Bug 32673
| Summary: | /dev/net/tun is created as a regular file if missing | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | Ivan Zakharyaschev <imz> |
| Component: | vpnc-script | Assignee: | Alexey Shabalin <shaba> |
| Status: | NEW --- | QA Contact: | qa-sisyphus |
| Severity: | minor | ||
| Priority: | P3 | CC: | shaba |
| Version: | unstable | ||
| Hardware: | all | ||
| OS: | Linux | ||
Проверка актуальности: актуально. В vpnc-script 0.5.3-alt7 строка 575: `if (exec 6<> /dev/net/tun) > /dev/null 2>&1` — открытие через `<>` идёт с O_CREAT, поэтому при отсутствии узла устройства создаётся обычный файл /dev/net/tun, и последующая ветка с mknod (строки 585–587) уже не срабатывает. Достаточно заменить проверку на `[ -c /dev/net/tun ]` или открывать через `<`. |

Description
Ivan Zakharyaschev 2016-10-27 14:43:27 MSKvpnc-script-0.5.3-alt6 In a system without systemd (and without any preceding "modprobe tun"), openconnect (which must be using vpnc-script): * would fail with unclear errors like this: ioctl(5, TUNSETIFF, 0x7fffbc71f7d0) = -1 ENOTTY (Inappropriate ioctl for device) * and would have created /dev/net/tun as a regular file like this: open("/dev/net/tun", O_RDWR|O_CREAT, 0666) = 3 (which would prevent the creation of a correct device afterwards). A similar case (probably, the same bug) has been reported as a Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=780709 Work-around: rm /dev/net/tun # if it's a wrong regular file modprobe -r tun modprobe tun