Fix inability to connect with unsecured wireless access point

Add plain-text connection failure messages
pull/16/head
Timothy Pearson 12 years ago
parent b282a7bb89
commit b4eb5d6af6

@ -1447,9 +1447,178 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessDeviceStateCha
m_prevDeviceState = newState; m_prevDeviceState = newState;
if (newState == NM_DEVICE_STATE_FAILED) { if (newState == NM_DEVICE_STATE_FAILED) {
TQString errorString;
if (reason == NM_DEVICE_STATE_REASON_NONE) {
errorString = TQString("Connection attempt failed!");
}
else if (reason == NM_DEVICE_STATE_REASON_UNKNOWN) {
errorString = TQString("Connection attempt failed!<br>Unknown error detected.");
}
else if (reason == NM_DEVICE_STATE_REASON_NOW_MANAGED) {
errorString = TQString("Connection attempt failed!<br>Network device is now managed.");
}
else if (reason == NM_DEVICE_STATE_REASON_NOW_UNMANAGED) {
errorString = TQString("Connection attempt failed!<br>Network device is now unmanaged.");
}
else if (reason == NM_DEVICE_STATE_REASON_CONFIG_FAILED) {
errorString = TQString("Connection attempt failed!<br>Configuration failed.");
}
else if (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE) {
errorString = TQString("Connection attempt failed!<br>IP configuration unavailable.");
}
else if (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED) {
errorString = TQString("Connection attempt failed!<br>IP configuration expired.");
}
else if (reason == NM_DEVICE_STATE_REASON_NO_SECRETS) {
errorString = i18n("Connection attempt failed!<br>Secrets were required to establish a connection, but no secrets were available.");
}
else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT) {
errorString = TQString("Connection attempt failed!<br>The supplicant was disconnected while attempting to establish a wireless connection.");
}
else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED) {
errorString = TQString("Connection attempt failed!<br>Supplicant configuration failed while attempting to establish a wireless connection.");
}
else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED) {
errorString = i18n("Connection attempt failed!<br>The supplicant failed while attempting to establish a wireless connection.");
}
else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT) {
errorString = i18n("Connection attempt failed!<br>The supplicant timed out while attempting to establish a wireless connection.");
}
else if (reason == NM_DEVICE_STATE_REASON_PPP_START_FAILED) {
errorString = i18n("Connection attempt failed!<br>The PPP client failed to start.");
}
else if (reason == NM_DEVICE_STATE_REASON_PPP_DISCONNECT) {
errorString = i18n("Connection attempt failed!<br>The PPP client was disconnected.");
}
else if (reason == NM_DEVICE_STATE_REASON_PPP_FAILED) {
errorString = i18n("Connection attempt failed!<br>Unknown PPP failure.");
}
else if (reason == NM_DEVICE_STATE_REASON_DHCP_START_FAILED) {
errorString = i18n("Connection attempt failed!<br>The DHCP client failed to start.");
}
else if (reason == NM_DEVICE_STATE_REASON_DHCP_ERROR) {
errorString = i18n("Connection attempt failed!<br>The DHCP client encountered an error.");
}
else if (reason == NM_DEVICE_STATE_REASON_DHCP_FAILED) {
errorString = i18n("Connection attempt failed!<br>Uknown DHCP failure.");
}
else if (reason == NM_DEVICE_STATE_REASON_SHARED_START_FAILED) {
errorString = i18n("Connection attempt failed!<br>The connection sharing service failed to start.");
}
else if (reason == NM_DEVICE_STATE_REASON_SHARED_FAILED) {
errorString = i18n("Connection attempt failed!<br>The connection sharing service encountered an error.");
}
else if (reason == NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED) {
errorString = i18n("Connection attempt failed!<br>The AutoIP service failed to start.");
}
else if (reason == NM_DEVICE_STATE_REASON_AUTOIP_ERROR) {
errorString = i18n("Connection attempt failed!<br>The AutoIP service encountered an error.");
}
else if (reason == NM_DEVICE_STATE_REASON_AUTOIP_FAILED) {
errorString = i18n("Connection attempt failed!<br>Unknown AutoIP failure.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_BUSY) {
errorString = i18n("Connection attempt failed!<br>Modem was busy.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE) {
errorString = i18n("Connection attempt failed!<br>No dial tone.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER) {
errorString = i18n("Connection attempt failed!<br>No carrier detected.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT) {
errorString = i18n("Connection attempt failed!<br>Modem timed out while dialing.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED) {
errorString = i18n("Connection attempt failed!<br>The modem failed to dial.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED) {
errorString = i18n("Connection attempt failed!<br>Modem initialization failed.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_APN_FAILED) {
errorString = i18n("Connection attempt failed!<br>GSM APN failure.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING) {
errorString = i18n("Connection attempt failed!<br>GSM registration failed to search for networks.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED) {
errorString = i18n("Connection attempt failed!<br>GSM registration attempt was rejected.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT) {
errorString = i18n("Connection attempt failed!<br>GSM registration attempt timed out.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED) {
errorString = i18n("Connection attempt failed!<br>GSM registration attempt failed.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED) {
errorString = i18n("Connection attempt failed!<br>GSM PIN check failed.");
}
else if (reason == NM_DEVICE_STATE_REASON_FIRMWARE_MISSING) {
errorString = i18n("Connection attempt failed!<br>Network device firmware is missing.");
}
else if (reason == NM_DEVICE_STATE_REASON_REMOVED) {
errorString = i18n("Connection attempt failed!<br>Network device was removed.");
}
else if (reason == NM_DEVICE_STATE_REASON_SLEEPING) {
errorString = i18n("Connection attempt failed!<br>Network device is sleeping.");
}
else if (reason == NM_DEVICE_STATE_REASON_CONNECTION_REMOVED) {
errorString = i18n("Connection attempt failed!<br>Connection was removed.");
}
else if (reason == NM_DEVICE_STATE_REASON_USER_REQUESTED) {
errorString = i18n("Connection attempt failed!<br>User requested device disconnection.");
}
else if (reason == NM_DEVICE_STATE_REASON_CARRIER) {
errorString = i18n("Connection attempt failed!<br>Carrier or link status changed.");
}
else if (reason == NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) {
errorString = i18n("Connection attempt failed!<br>Device and/or connection already active.");
}
else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE) {
errorString = i18n("Connection attempt failed!<br>The supplicant is now available.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND) {
errorString = i18n("Connection attempt failed!<br>Requested modem was not found.");
}
else if (reason == NM_DEVICE_STATE_REASON_BT_FAILED) {
errorString = i18n("Connection attempt failed!<br>Bluetooth connection timeout.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_NOT_INSERTED) {
errorString = i18n("Connection attempt failed!<br>GSM SIM not inserted.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED) {
errorString = i18n("Connection attempt failed!<br>GSM PIN required.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_PUK_REQUIRED) {
errorString = i18n("Connection attempt failed!<br>GSM PUK required.");
}
else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_WRONG) {
errorString = i18n("Connection attempt failed!<br>GSM SIM incorrect.");
}
else if (reason == NM_DEVICE_STATE_REASON_INFINIBAND_MODE) {
errorString = i18n("Connection attempt failed!<br>Incorrect Infiniband mode.");
}
else if (reason == NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED) {
errorString = i18n("Connection attempt failed!<br>Dependency failure.");
}
else if (reason == NM_DEVICE_STATE_REASON_BR2684_FAILED) {
errorString = i18n("Connection attempt failed!<br>Unknown bridge failure.");
}
else if (reason == NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE) {
errorString = i18n("Connection attempt failed!<br>ModemManager not available.");
}
else if (reason == NM_DEVICE_STATE_REASON_SSID_NOT_FOUND) {
errorString = i18n("Connection attempt failed!<br>SSID not found.");
}
else if (reason == NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED) {
errorString = i18n("Connection attempt failed!<br>Secondary connection failure.");
}
else {
// FIXME // FIXME
// This should provide a plain-text interpretation of the NetworkManager-specific error code // This should provide a plain-text interpretation of the NetworkManager-specific error code
m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::Failure, TQString("Connection attempt failed!<br>NetworkManager returned error %1.").arg(reason)); errorString = TQString("Connection attempt failed!<br>NetworkManager returned error %1.").arg(reason);
}
m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::Failure, errorString);
} }
m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->m_macAddress); m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->m_macAddress);
@ -3783,16 +3952,10 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection*
if (wiFiConnection) { if (wiFiConnection) {
TQMap<TQString, TQT_DBusData> settingsMap = dbusData.toStringKeyMap().toTQMap(); TQMap<TQString, TQT_DBusData> settingsMap = dbusData.toStringKeyMap().toTQMap();
{ {
{ if (wiFiConnection->securityRequired) {
if (wiFiConnection->securityRequired) { if (wiFiConnection->securityRequired) {
settingsMap["key-mgmt"] = convertDBUSDataToVariantData(TQT_DBusData::fromString(tdeWiFiKeyTypeToNMWiFiKeyType(wiFiConnection->securitySettings.keyType))); settingsMap["key-mgmt"] = convertDBUSDataToVariantData(TQT_DBusData::fromString(tdeWiFiKeyTypeToNMWiFiKeyType(wiFiConnection->securitySettings.keyType)));
} }
else {
// The key-mgmt entry seems to be required even if no security is available and/or enabled!
// settingsMap.remove("key-mgmt");
settingsMap["key-mgmt"] = convertDBUSDataToVariantData(TQT_DBusData::fromString("none"));
}
}
if (wiFiConnection->securitySettings.wepKeyIndex > 0) { if (wiFiConnection->securitySettings.wepKeyIndex > 0) {
settingsMap["wep-tx-keyidx"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(wiFiConnection->securitySettings.wepKeyIndex)); settingsMap["wep-tx-keyidx"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(wiFiConnection->securitySettings.wepKeyIndex));
} }
@ -3865,6 +4028,26 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection*
settingsMap.remove("leap-password"); settingsMap.remove("leap-password");
} }
} }
else {
settingsMap.remove("key-mgmt");
settingsMap.remove("wep-tx-keyidx");
settingsMap.remove("auth-alg");
settingsMap.remove("proto");
settingsMap.remove("pairwise");
settingsMap.remove("group");
settingsMap.remove("leap-username");
settingsMap.remove("wep-key-flags");
settingsMap.remove("wep-key-type");
settingsMap.remove("psk-flags");
settingsMap.remove("leap-password-flags");
settingsMap.remove("wep-key0");
settingsMap.remove("wep-key1");
settingsMap.remove("wep-key2");
settingsMap.remove("wep-key3");
settingsMap.remove("psk");
settingsMap.remove("leap-password");
}
}
dbusData = TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap<TQString>(settingsMap)); dbusData = TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap<TQString>(settingsMap));
groupValid = (settingsMap.count() > 0); groupValid = (settingsMap.count() > 0);
} }

@ -145,6 +145,67 @@
#define NM_PLUGIN_SERVICE_DIR "/etc/NetworkManager/VPN" #define NM_PLUGIN_SERVICE_DIR "/etc/NetworkManager/VPN"
//==================================================================================================== //====================================================================================================
//====================================================================================================
// Device state change reason codes
// Taken from NetworkManager.h
//====================================================================================================
#define NM_DEVICE_STATE_REASON_NONE 0
#define NM_DEVICE_STATE_REASON_UNKNOWN 1
#define NM_DEVICE_STATE_REASON_NOW_MANAGED 2
#define NM_DEVICE_STATE_REASON_NOW_UNMANAGED 3
#define NM_DEVICE_STATE_REASON_CONFIG_FAILED 4
#define NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE 5
#define NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED 6
#define NM_DEVICE_STATE_REASON_NO_SECRETS 7
#define NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT 8
#define NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED 9
#define NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED 10
#define NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT 11
#define NM_DEVICE_STATE_REASON_PPP_START_FAILED 12
#define NM_DEVICE_STATE_REASON_PPP_DISCONNECT 13
#define NM_DEVICE_STATE_REASON_PPP_FAILED 14
#define NM_DEVICE_STATE_REASON_DHCP_START_FAILED 15
#define NM_DEVICE_STATE_REASON_DHCP_ERROR 16
#define NM_DEVICE_STATE_REASON_DHCP_FAILED 17
#define NM_DEVICE_STATE_REASON_SHARED_START_FAILED 18
#define NM_DEVICE_STATE_REASON_SHARED_FAILED 19
#define NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED 20
#define NM_DEVICE_STATE_REASON_AUTOIP_ERROR 21
#define NM_DEVICE_STATE_REASON_AUTOIP_FAILED 22
#define NM_DEVICE_STATE_REASON_MODEM_BUSY 23
#define NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE 24
#define NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER 25
#define NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT 26
#define NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED 27
#define NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED 28
#define NM_DEVICE_STATE_REASON_GSM_APN_FAILED 29
#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING 30
#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED 31
#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT 32
#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED 33
#define NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED 34
#define NM_DEVICE_STATE_REASON_FIRMWARE_MISSING 35
#define NM_DEVICE_STATE_REASON_REMOVED 36
#define NM_DEVICE_STATE_REASON_SLEEPING 37
#define NM_DEVICE_STATE_REASON_CONNECTION_REMOVED 38
#define NM_DEVICE_STATE_REASON_USER_REQUESTED 39
#define NM_DEVICE_STATE_REASON_CARRIER 40
#define NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED 41
#define NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE 42
#define NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND 43
#define NM_DEVICE_STATE_REASON_BT_FAILED 44
#define NM_DEVICE_STATE_REASON_GSM_SIM_NOT_INSERTED 45
#define NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED 46
#define NM_DEVICE_STATE_REASON_GSM_SIM_PUK_REQUIRED 47
#define NM_DEVICE_STATE_REASON_GSM_SIM_WRONG 48
#define NM_DEVICE_STATE_REASON_INFINIBAND_MODE 49
#define NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED 50
#define NM_DEVICE_STATE_REASON_BR2684_FAILED 51
#define NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE 52
#define NM_DEVICE_STATE_REASON_SSID_NOT_FOUND 53
#define NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED 54
//====================================================================================================
class TDENetworkConnectionManager_BackendNMPrivate; class TDENetworkConnectionManager_BackendNMPrivate;
class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkConnectionManager class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkConnectionManager

Loading…
Cancel
Save