[network-manager-openvpn] properties: fix validation of static-key in GUI



commit b83f028a6da067dcc9b31555c15411f0288ebda1
Author: Brandon Guttersohn <bguttersohn gmail com>
Date:   Wed Sep 27 09:57:58 2017 +0200

    properties: fix validation of static-key in GUI
    
    Otherwise it's not possible to edit a connection with static key.
    
    [thaller redhat com: modified original patch and add commit message]
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788226
    
    Fixes: 86a70095afc229f1f970b7e546390d166152cfc2

 properties/auth-helpers.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index c55afd1..16ff6e5 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -449,7 +449,7 @@ auth_widget_check_validity (GtkBuilder *builder, const char *contype, GError **e
        } else if (!strcmp (contype, NM_OPENVPN_CONTYPE_STATIC_KEY)) {
                widget = GTK_WIDGET (gtk_builder_get_object (builder, "sk_key_chooser"));
                filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
-               if (filename && strlen (filename)) {
+               if (!filename || !filename[0]) {
                        g_free (filename);
                        g_set_error (error,
                                     NMV_EDITOR_PLUGIN_ERROR,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]