mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-03 12:30:46 +01:00
WIP: manager: check device path on AddAndActivate
validate_activation_request() just acts as if a no device was passed if nm_manager_get_device_by_path() can't resolve the path into a NMDevice. That means a bogus path name is silently ignored. TODO: Check if that's indeed the case
This commit is contained in:
parent
c92f9963c8
commit
4621a9a8a4
1 changed files with 11 additions and 0 deletions
|
|
@ -6584,6 +6584,17 @@ impl_manager_add_and_activate_connection(NMDBusObject *obj,
|
|||
specific_object_path = nm_dbus_path_not_empty(specific_object_path);
|
||||
device_path = nm_dbus_path_not_empty(device_path);
|
||||
|
||||
if (device_path) {
|
||||
device = nm_manager_get_device_by_path(self, device_path);
|
||||
if (!device) {
|
||||
error = g_error_new(NM_MANAGER_ERROR,
|
||||
NM_MANAGER_ERROR_UNKNOWN_DEVICE,
|
||||
"Device does not exist: %s",
|
||||
device_path);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to create a new connection with the given settings.
|
||||
* We allow empty settings for AddAndActivateConnection(). In that case,
|
||||
* the connection will be completed in nm_utils_complete_generic() or
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue