Commit f7726cdf authored by intrigeri's avatar intrigeri

Merge branch...

Merge branch 'wip/bugfix/17784-make-MAC-spoofing-failure-msgs-more-useful-and-resilient' into 'stable'

Include in MAC spoofing notification failures a network card name that users can relate to

See merge request !69
parents 80d3adcb 56a11b3e
......@@ -43,9 +43,9 @@ get_module_used_by_nic() {
}
get_name_of_nic() {
vendor=$(sed 's/^0x\(.*\)$/\1/' "/sys/class/net/${1}/device/vendor")
device=$(sed 's/^0x\(.*\)$/\1/' "/sys/class/net/${1}/device/device")
lspci -nn | sed -n "s/^\S\+\s\+[^:]\+:\s\+\(.*\)\s\+\[$vendor:$device\].*$/\1/p"
vendor=$(udevadm info -x --query=property /sys/class/net/${1} | sed -n "s/ID_VENDOR_FROM_DATABASE='\(.*\)'/\\1/p" || : )
device=$(udevadm info -x --query=property /sys/class/net/${1} | sed -n "s/ID_MODEL_FROM_DATABASE='\(.*\)'/\\1/p" || : )
echo "${vendor} ${device}"
}
# Auxillary function for mod_rev_dep(). It recurses over the graph of
......
......@@ -49,7 +49,7 @@ notify_panic_success() {
local nic_name
nic="${1}"
nic_name="${2}"
show_notification "`gettext \"Network card \\\${nic} disabled\"`" \
show_notification "`eval_gettext \"Network card \\\${nic} disabled\"`" \
"`eval_gettext \"MAC spoofing failed for network card \\\${nic_name} (\\\${nic}) so it is temporarily disabled.
You might prefer to restart Tails and disable MAC spoofing.\"`"
}
......@@ -139,7 +139,8 @@ done
# point we have to take some drastic measures in order to prevent
# potential leaks.
if [ -z "${OLD_MAC:-}" ] || [ -z "${NEW_MAC:-}" ] || \
[ "${OLD_MAC:-}" = "${NEW_MAC:-}" ]
[ "${OLD_MAC:-}" = "${NEW_MAC:-}" ] || \
grep -qs -w 'debug=test_mac_spoof_panic' /proc/cmdline
then
log "Failed to spoof MAC address of NIC ${NIC}. Going into panic mode."
if ! mac_spoof_panic "${NIC}"; then
......
......@@ -40,8 +40,7 @@ Feature: Spoofing MAC addresses
When I log in to a new session
Then no network interfaces are enabled
And no network device leaked the real MAC address
# XXX: workaround for #17784
And I see the "Network card disabled" notification after at most 60 seconds
And I see the "Network card eth0 disabled" notification after at most 60 seconds
Scenario: MAC address spoofing fails and macchanger returns true
Given I have started Tails from DVD without network and stopped at Tails Greeter's login screen
......@@ -51,8 +50,7 @@ Feature: Spoofing MAC addresses
When I log in to a new session
Then no network interfaces are enabled
And no network device leaked the real MAC address
# XXX: workaround for #17784
And I see the "Network card disabled" notification after at most 60 seconds
And I see the "Network card eth0 disabled" notification after at most 60 seconds
Scenario: MAC address spoofing fails and the module is not removed
Given I have started Tails from DVD without network and stopped at Tails Greeter's login screen
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment