D27661: wireguard: Trim IP list before submitting to NM

2020-02-26 Thread Jan Grulich
This revision was automatically updated to reflect the committed changes.
Closed by commit R116:b7daee75ee0e: wireguard: Trim IP list before submitting 
to NM (authored by Haochen Tong i...@hexchain.org, committed by 
jgrulich).

REPOSITORY
  R116 Plasma Network Management Applet

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D27661?vs=76418=76515

REVISION DETAIL
  https://phabricator.kde.org/D27661

AFFECTED FILES
  libs/editor/settings/wireguardpeerwidget.cpp

To: hexchain, jgrulich
Cc: usta, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, 
zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27661: wireguard: Trim IP list before submitting to NM

2020-02-25 Thread hexchain
hexchain updated this revision to Diff 76418.
hexchain edited the summary of this revision.
hexchain edited the test plan for this revision.
hexchain added a comment.


  Edited summary according to guidelines

REPOSITORY
  R116 Plasma Network Management Applet

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D27661?vs=76417=76418

BRANCH
  arcpatch-D27661

REVISION DETAIL
  https://phabricator.kde.org/D27661

AFFECTED FILES
  libs/editor/settings/wireguardpeerwidget.cpp

To: hexchain, jgrulich
Cc: usta, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, 
zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27661: wireguard: Trim IP list before submitting to NM

2020-02-25 Thread hexchain
hexchain updated this revision to Diff 76417.
hexchain added a comment.


  Updated according to comments.

REPOSITORY
  R116 Plasma Network Management Applet

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D27661?vs=76414=76417

REVISION DETAIL
  https://phabricator.kde.org/D27661

AFFECTED FILES
  libs/editor/settings/wireguardpeerwidget.cpp

To: hexchain, jgrulich
Cc: usta, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, 
zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27661: wireguard: Trim IP list before submitting to NM

2020-02-25 Thread Ömer Fadıl Usta
usta added inline comments.

INLINE COMMENTS

> wireguardpeerwidget.cpp:197
> +
> +for (QString  : rawIPList) {
> +ipList.append(ip.trimmed());

const

REPOSITORY
  R116 Plasma Network Management Applet

REVISION DETAIL
  https://phabricator.kde.org/D27661

To: hexchain, jgrulich
Cc: usta, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, 
zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart


D27661: wireguard: Trim IP list before submitting to NM

2020-02-25 Thread hexchain
hexchain created this revision.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
Herald added a reviewer: jgrulich.
hexchain requested review of this revision.

REVISION SUMMARY
  The `SimpleIpListValidator` validates each trimmed item in a comma-separated 
list, but `WireGuardPeerWidget` sets `peerData` without trimming each item. 
Untrimmed items are not accepted by NetworkManager, so the user might see NM 
rejecting values that are valid in the peer settings dialog.
  
  Fix this discrepancy by trimming each item before setting `peerData`.

TEST PLAN
  1. Type a comma-separated list of IP addresses, with spaces around comma, 
into the "Allowed IPs" field of the WireGuard peer settings dialog.
  2. Save the connection. No error should be reported by NM.

REPOSITORY
  R116 Plasma Network Management Applet

REVISION DETAIL
  https://phabricator.kde.org/D27661

AFFECTED FILES
  libs/editor/settings/wireguardpeerwidget.cpp

To: hexchain, jgrulich
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, 
fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart