From cf5e759978d0301711bd438ba16deefcf5151c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 5 Mar 2014 12:43:14 +0100 Subject: [PATCH] team: replace NL chars in team config when passing to libteamdctl (rh #1051517) usock interface in libteamdctl uses \n as a parameter separator and thus would cut the config. So we replace '\r' and '\n' with ' '. https://bugzilla.redhat.com/show_bug.cgi?id=1051517 --- src/devices/nm-device-team.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device-team.c b/src/devices/nm-device-team.c index 1cc7641f3..a82b4c6bf 100644 --- a/src/devices/nm-device-team.c +++ b/src/devices/nm-device-team.c @@ -679,8 +679,11 @@ enslave_slave (NMDevice *device, iface, slave_iface); } else { int err; + char *sanitized_config; - err = teamdctl_port_config_update_raw (priv->tdc, slave_iface, config); + sanitized_config = g_strdelimit (g_strdup (config), "\r\n", ' '); + err = teamdctl_port_config_update_raw (priv->tdc, slave_iface, sanitized_config); + g_free (sanitized_config); if (err != 0) { nm_log_err (LOGD_TEAM, "(%s): failed to update config for port %s (err=%d)", iface, slave_iface, err);