Commit Graph

1502 Commits

Author SHA1 Message Date
Dan Williams
050a31e50d core: increase SSID buffer size to fix 32-character SSIDs (rh #485312, lp281755) 2009-02-12 16:25:19 -05:00
Dan Williams
ed274df7c7 rfkill: rework to handle new dynamic HAL killswitches
Requires HAL 0.5.12 as of 2008-11-19 and kernel 2.6.27 or later; if
any dynamic killswitches are found, polled killswitches are ignored.
This is half the fix; the other half is to do something intelligent
with the rfkill state instead of taking the wifi devices down.
2009-02-10 23:06:24 -05:00
Dan Williams
2445f78e07 core: remove stray semi-colon 2009-02-10 18:30:59 -05:00
Tambet Ingo
614d1c7712 Use the correct signature for DeviceAdded and DeviceRemoved MM signals. 2009-02-10 15:34:21 +02:00
Dan Williams
555dfd35e6 core: allow uid 0 to activate user connections
Previously, uid 0 was not permitted to activate user connections,
but in some cases this is desired.
2009-02-10 06:31:50 -05:00
Tambet Ingo
a772546212 Convert MM errors to NM state reasons. 2009-02-09 11:01:35 +02:00
Tambet Ingo
c4b10085c9 Use the existing dbus-glib macros. 2009-02-09 11:01:35 +02:00
Tambet Ingo
eaa93b0387 Remove HSO and MBM modem implementations and replace them with generic code. 2009-02-09 11:01:35 +02:00
Tambet Ingo
10784dd1b6 Use the 'Simple' modem interface. 2009-02-09 11:01:35 +02:00
Tambet Ingo
9c0d6b468d Share some utility helper functions to send hash tables containing GValues over dbus. 2009-02-09 11:01:35 +02:00
Tambet Ingo
e4398a88c8 Use ModemManager. 2009-02-09 11:01:35 +02:00
Dan Williams
ce3473dc90 clear pending activation checks on device removal
Found by Drew Moseley <dmoseley@mvista.com>
2009-02-06 15:38:09 -05:00
Dan Williams
675a01ab9a fix dbus conf file broken by 7c3063faea 2009-02-05 07:15:04 -05:00
Dan Williams
7c3063faea ppp: don't require separate bus name for pppd plugin communication
Not actually needed, and actually makes securing the daemon harder
from a D-Bus perspective, since both bus names resolve to the same
unique name anyway, and the unique name is what actually gets
matched on inside dbus.  Suggestion from Colin Walters.
2009-02-05 06:05:10 -05:00
Dan Williams
718debc2cd fix distcheck for real 2009-02-02 01:36:43 -05:00
Michael Biebl
8a2393ade2 vpn: ignore VPN service files that don't end in .name 2009-01-30 00:00:12 -05:00
Dan Williams
468ca67a1f ppp: always use 'noauth'
Since NM is really only a client of the provider's PPP server, and since NM
doesn't have any authentication information to authenticate the remote
peer anyway.  Some providers don't set up their servers to allow clients to
ask for authentication from the remote peer either.
2009-01-28 11:49:28 -05:00
Dan Williams
4a7bfefeec ppp: honor MTU from PPP setting 2009-01-26 16:10:19 -05:00
Dan Williams
d7e671ddad make distcheck happier (but still not completely happy) 2009-01-22 19:38:53 -05:00
Przemysław Grzegorczyk
bac45aa0d5 clean up glib includes (bgo #564376)
Only <glib.h> and <gtk/gtk.h> need to be included.
2009-01-19 00:16:40 -05:00
Dan Williams
f2e8870338 dhcp: handle classless static routes (bgo #567246)
Based on patches by Johan Bilien <jobi@via.ecp.fr>,
nick loeve <trickie@gmail.com>, and Roy Marples <roy@marples.name>
with significant changes for dhclient formatting and test cases.

Note that dhclient needs help before it can actually parse
classless static routes by adding the following to the
dhclient.conf file:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
2009-01-18 23:19:09 -05:00
Dan Williams
f06a136a99 move nm_utils_ip4_addr_to_nl_addr() to nm-ip4-config.c
Since that's the only place it's used.
2009-01-18 20:04:14 -05:00
Dan Williams
4aab9ff556 gsm: add init string for USBModem by MobileStream for Palm devices 2009-01-16 16:41:54 -05:00
Sjoerd Simons
c96333de17 gsm: handle different modem init sequences more elegantly
Change the encoding on the channel to binary too, since modems usually don't
send UTF-8.
2009-01-16 16:40:59 -05:00
Dan Williams
0400af7d03 Clarify variable name 2009-01-12 10:44:00 -05:00
Dan Williams
a10775c928 Merge branch wins-in-ip4-config 2009-01-04 19:15:03 -05:00
Jan Kantert
4ca66db721 Use g_timeout_add_seconds() to reduce wakeups
(and refine the older glib compat mechanism, by Dan)
2008-12-31 18:57:36 -05:00
Dan Williams
3f907cb9e3 License header and FSF address update 2008-12-20 09:46:41 -05:00
Michael Biebl
c733dbf6d0 Remove .cvsignore file, they are obsolete 2008-12-19 21:23:08 -05:00
Dan Williams
a020ed21da Re-add WINS support to the IPv4 config
Don't do anything with WINS servers (dispatcher scripts installed with
samba could certainly update samba's idea of WINS servers), but at least
provide them so that the VPNs that can get upstream WINS servers can
at least make other stuff aware of them.
2008-12-19 17:01:06 -05:00
Dan Williams
706118b9db Use correct dhclient leasefile location for Debian systems
Patch by Michael Biebl <mbiebl@debian.org>
2008-12-16 15:24:38 -05:00
Dan Williams
948ee274da 2008-12-09 Dan Williams <dcbw@redhat.com>
* libnm-util/libnm-util.ver
	  libnm-util/nm-setting-ip4-config.c
	  libnm-util/nm-setting-ip4-config.h
		- Add 'never-default' property, which when true indicates that a
			connection should never be the default connection

	* src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- (nm_ip4_config_get_never_default, nm_ip4_config_set_never_default):
			Add never-default helpers

	* src/NetworkManagerUtils.c
		- (nm_utils_merge_ip4_config): update never-default when merging the
			IP4 setting to the IP4 config

	* src/NetworkManagerSystem.c
		- (nm_system_apply_ip4_config): if the connection is never-default,
			don't add routes without a gateway

	* src/NetworkManagerPolicy.c
		- (get_best_device): don't let never-default connections be the best
		- (update_routing_and_dns): handle never-default for VPN connections

	* system-settings/plugins/ifcfg-rh/reader.c
		- (make_ip4_setting): handle never-default by checking GATEWAYDEV



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/branches/NETWORKMANAGER_0_7@4378 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-12-09 20:01:49 +00:00
Dan Williams
6bfade3227 2008-12-08 Dan Williams <dcbw@redhat.com>
* src/vpn-manager/nm-vpn-connection.c
		- (plugin_state_changed): clear secrets before setting the connection
			state to FAILED, since doing so may destroy the connection itself,
			since the NMVPNService owning this NMVPNConnection will unref it
			when the NMVPNConnection is failed or stopped



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/branches/NETWORKMANAGER_0_7@4374 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-12-08 15:24:38 +00:00
Dan Williams
82d598cdee Fix literal error message
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/branches/NETWORKMANAGER_0_7@4361 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-12-03 23:14:59 +00:00
Dan Williams
9e6d9e298b 2008-11-25 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo <tambet@gmail.com>

	Fix mishandling of netlink error floods (rh #459205, novell #443429, lp #284507)

	* src/nm-netlink-monitor.c
		- Remove bits for using a non-default GMainContext, which weren't used
		- (nm_netlink_monitor_error_handler): don't leak the GError, and report
			the actual error code

	* src/NetworkManager.c
		- (nm_error_monitoring_device_link_state): disconnect error handler when
			an error flood occurs to avoid pegging the CPU



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4334 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-25 18:30:44 +00:00
Dan Williams
f30fba23ee 2008-11-21 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo  <tambet@gmail.com>

	* configure.in
	  libnm-util/libnm-util.ver
	  libnm-util/nm-setting-8021x.c
	  libnm-util/nm-setting-8021x.h
		- Add configure-time option for the system CA path
		- Add 'system-ca-certs' option to 802.1x setting, which directs
			NetworkManager to use system CA certificates instead of any
			connection-defined CA certificates

	* src/supplicant-manager/nm-supplicant-config.c
	  src/supplicant-manager/nm-supplicant-settings-verify.c
		- Use system CA certificates if the connection says to do so



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4326 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-21 18:59:37 +00:00
Dan Williams
9ea3dafe7d 2008-11-21 Dan Williams <dcbw@redhat.com>
* src/nm-dbus-manager.c
	  src/nm-dbus-manager.h
		- (nm_dbus_manager_get_name_owner): return error

	* src/nm-manager.c
		- (impl_manager_activate_connection): perform additional validation on
			ActivateConnection calls of user connections
		- (is_user_request_authorized): ensure that the requestor is the same
			UID as the UID that owns the user settings service; users shouldn't
			be able to control another user's connections



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4325 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-21 18:11:15 +00:00
Dan Williams
320c3f378c 2008-11-20 Dan Williams <dcbw@redhat.com>
* libnm-util/libnm-util.ver
	  libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- Add NMSetting errors
		- (nm_setting_update_secrets): return errors

	* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_update_secrets): return errors

	* libnm-util/nm-setting-vpn.c
	  src/nm-activation-request.c
	  src/vpn-manager/nm-vpn-connection.c
		- Handle update secrets errors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4314 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-20 15:44:57 +00:00
Dan Williams
6e40cdb3a5 2008-11-20 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
	  libnm-util/libnm-util.ver
		- (nm_setting_new_from_hash): rename from nm_setting_from_hash() to be
			consistent with nm_connection_new_from_hash()

	* src/nm-activation-request.c
	  libnm-util/nm-connection.c
		- Handle rename



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4312 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-20 14:47:08 +00:00
Dan Williams
c47cdcf0e7 2008-11-19 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.h
	  libnm-util/nm-setting.c
	  src/nm-device.c
	  src/nm-manager.c
	  system-settings/plugins/ifcfg-fedora/plugin.c
		- Prefix compare flag defines with NM_SETTING_



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4299 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-19 16:20:47 +00:00
Dan Williams
3c2d8253ec 2008-11-19 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_replace_settings): take a GError

	* libnm-glib/nm-settings.c
	  libnm-glib/nm-dbus-connection.c
	  src/nm-manager.c
	  system-settings/plugins/ifcfg-suse/nm-suse-connection.c
	  system-settings/plugins/keyfile/nm-keyfile-connection.c
	  system-settings/plugins/keyfile/plugin.c
		- Handle, or don't handle, errors from nm_connection_replace_settings()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4298 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-19 15:09:05 +00:00
Dan Williams
fcf593dc09 2008-11-17 Dan Williams <dcbw@redhat.com>
* src/nm-hso-gsm-device.c
		- (real_connection_secrets_updated): handle PIN/PUK correctly for HSO
			devices



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4296 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-18 14:40:37 +00:00
Dan Williams
3f0d6cd233 2008-11-14 Dan Williams <dcbw@redhat.com>
Handle gateways on different subnets

	* src/NetworkManagerSystem.c
		- (add_ip4_route_to_gateway): gateway route should be link scope and
			a host route
		- (replace_default_ip4_route): use a destination address too; gateway
			address should be /0; don't leak the gateway route object



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4290 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-14 20:42:38 +00:00
Dan Williams
a2967685db 2008-11-14 Dan Williams <dcbw@redhat.com>
* vpn-manager/nm-vpn-connection.c
		- (plugin_state_changed): clear VPN secrets on error to ensure they
			are always requested from the settings service (rh #429287)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4282 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-14 15:23:08 +00:00
Dan Williams
e2f65ce12a 2008-11-13 Dan Williams <dcbw@redhat.com>
Add support for PKCS#12 private keys (bgo #558982)

	* libnm-util/crypto.c
	  libnm-util/crypto.h
		- (parse_old_openssl_key_file): rename from parse_key_file(); adapt to
			take a GByteArray instead of a filename
		- (file_to_g_byte_array): handle private key files too
		- (decrypt_key): take a GByteArray rather than data + len
		- (crypto_get_private_key_data): refactor crypto_get_private_key() into
			one function that takes a filename, and one that takes raw data;
			detect pkcs#12 files as well
		- (crypto_load_and_verify_certificate): detect file type
		- (crypto_is_pkcs12_data, crypto_is_pkcs12_file): add pkcs#12 detection
			functions

	* libnm-util/crypto_gnutls.c
		- (crypto_decrypt): take GByteArray rather than data + len; fix a bug
			whereby tail padding was incorrectly handled, leading to erroneous
			successes when trying to decrypt the data
		- (crypto_verify_cert): rework somewhat
		- (crypto_verify_pkcs12): validate pkcs#12 keys

	* libnm-util/crypto_nss.c
		- (crypto_init): enable various pkcs#12 ciphers
		- (crypto_decrypt): take a GByteArray rather than data + len
		- (crypto_verify_cert): clean up
		- (crypto_verify_pkcs12): validate pkcs#12 keys

	* libnm-util/test-crypto.c
		- Handle pkcs#12 keys

	* libnm-util/nm-setting-8021x.c
	  libnm-util/nm-setting-8021x.h
	  libnm-util/libnm-util.ver
		- Add two new properties, 'private-key-password' and
			'phase2-private-key-password', to be used in conjunction with
			pkcs#12 keys
		- (nm_setting_802_1x_set_ca_cert_from_file,
		   nm_setting_802_1x_set_client_cert_from_file,
		   nm_setting_802_1x_set_phase2_ca_cert_from_file,
		   nm_setting_802_1x_set_phase2_client_from_file): return certificate
			type
		- (nm_setting_802_1x_get_private_key_password,
		   nm_setting_802_1x_get_phase2_private_key_password): return private
			key passwords
		- (nm_setting_802_1x_set_private_key_from_file,
		   nm_setting_802_1x_set_phase2_private_key_from_file): set the private
			key from a file, and update the private key password at the same time
		- (nm_setting_802_1x_get_private_key_type,
		   nm_setting_802_1x_get_phase2_private_key_type): return the private
			key type

	* src/supplicant-manager/nm-supplicant-settings-verify.c
		- Whitelist private key passwords

	* src/supplicant-manager/nm-supplicant-config.c
		- (nm_supplicant_config_add_setting_8021x): for pkcs#12 private keys,
			add the private key password to the supplicant config, but do not
			add the client certificate (as required by wpa_supplicant)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4280 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-13 21:19:08 +00:00
Dan Williams
214114fb2d 2008-11-07 Dan Williams <dcbw@redhat.com>
Fix deletion of VPN gateway route on DHCP renew (bgo #558133)

	* src/NetworkManagerSystem.c
	  src/NetworkManagerSystem.h
		- (nm_system_device_set_ip4_route): return the route that was added
		- (nm_system_add_ip4_vpn_gateway_route): make add_vpn_gateway_route()
			public, clean up, and return the route that was added
		- (nm_system_apply_ip4_config): remove VPN related stuff to simplify,
			since nm_system_add_ip4_vpn_gateway_route() is now available; add
			flags to allow only certain attributes of the NMIP4Config to be
			applied

	* src/nm-device.c
		- (handle_dhcp_lease_change): don't touch the DHCP4 config on failure
		- (nm_device_set_ip4_config): use nm_ip4_config_diff() to only apply
			what's really changed between the old and new configs; don't export
			the new IP4 config on failure; always send the DNS info to the
			named manager

	* src/vpn-manager/nm-vpn-connection.c
		- (device_ip4_config_changed, nm_vpn_connection_new, dispose): track the
			parent device's IP4Config and re-add the VPN gateway route when it
			changes
		- (nm_vpn_connection_ip4_config_get): add the VPN gateway route (since
			nm_system_apply_ip4_config() no longer does) and cache it for later
		- (connection_state_changed): move cleanup code to its own function
		- (vpn_cleanup): delete any previously added VPN gateway route; and
			re-apply the parent device's addresses and routes using
			nm_system_apply_ip4_config(), not nm_device_set_ip4_config()



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4277 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-07 13:57:39 +00:00
Dan Williams
9340a4122f 2008-11-07 Dan Williams <dcbw@redhat.com>
* src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- (nm_ip4_config_diff): new function; return the difference between two
			IP4 configs
		- (nm_ip4_config_compare): change into nm_ip4_config_diff



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4275 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-07 13:43:15 +00:00
Dan Williams
3c8494753d 2008-11-05 Dan Williams <dcbw@redhat.com>
* nm-ip4-config.c
	  nm-ip4-config.h
		- (nm_ip4_config_compare): compare two IP4 configs



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4271 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-06 04:04:51 +00:00
Dan Williams
0f4c227c1f 2008-11-05 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerPolicy.c
		- (update_etc_hosts): only add newline if not the last line of the file
			(Jonathan Miner)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4268 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-05 17:43:45 +00:00
Dan Williams
1b075023fa 2008-11-05 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-dhclient.c
		- (get_leasefile_for_iface): move lease files back to where dhclient
			puts them



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4267 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-05 17:18:13 +00:00