[network-manager-openswan/dcbw/cleanups: 8/18] core: remove dead or commented code



commit a50220391d9aefafadf6f2fd4b44d539e8eb6647
Author: Dan Williams <dcbw redhat com>
Date:   Mon Aug 4 15:48:46 2014 -0500

    core: remove dead or commented code

 src/nm-openswan-service.c |   60 +--------------------------------------------
 1 files changed, 1 insertions(+), 59 deletions(-)
---
diff --git a/src/nm-openswan-service.c b/src/nm-openswan-service.c
index c656b7d..966cd7b 100644
--- a/src/nm-openswan-service.c
+++ b/src/nm-openswan-service.c
@@ -394,7 +394,6 @@ write_config_option (int fd, const char *format, ...)
 }
 
 typedef struct {
-       //int fd;
        int conf_fd;
        int secret_fd;
        NMSettingVPN *s_vpn;
@@ -409,8 +408,6 @@ write_one_property (const char *key, const char *value, gpointer user_data)
        WriteConfigInfo *info = (WriteConfigInfo *) user_data;
        GType type = G_TYPE_INVALID;
        int i;
-       //const char *default_username;
-       //const char *props_username;
        const char *leftid;
 
        if (info->error)
@@ -453,48 +450,10 @@ write_one_property (const char *key, const char *value, gpointer user_data)
                return;
 
        if (type == G_TYPE_STRING) {
-               //write_config_option (info->fd, "%s %s\n", (char *) key, (char *) value);
-
                if (!strcmp (key, NM_OPENSWAN_PSK_VALUE)) {
-                       leftid=nm_setting_vpn_get_data_item (info->s_vpn, NM_OPENSWAN_LEFTID);
+                       leftid = nm_setting_vpn_get_data_item (info->s_vpn, NM_OPENSWAN_LEFTID);
                        write_config_option (info->secret_fd, "@%s: PSK \"%s\"\n", leftid, (char *) value);
                }
-
-               /*if (!strcmp (key, NM_OPENSWAN_XAUTH_PASSWORD)) {
-               default_username = nm_setting_vpn_get_user_name (info->s_vpn);
-               props_username = nm_setting_vpn_get_data_item (info->s_vpn, NM_OPENSWAN_LEFTXAUTHUSER);
-                       if ( default_username && strlen (default_username)
-                               && (!props_username || !strlen (props_username))) {
-                       write_config_option (info->secret_fd, "@%s : XAUTH \"%s\"\n",default_username, (char 
*) value);
-                       } else {
-                       write_config_option (info->secret_fd, "@%s : XAUTH \"%s\"\n", props_username, (char 
*) value);
-                       }
-               }*/
-
-       } else if (type == G_TYPE_BOOLEAN) {
-               if (!strcmp (value, "yes")) {
-                       //write_config_option (info->fd, "%s\n", (char *) key);
-               }
-       } else if (type == G_TYPE_INT) {
-               long int tmp_int;
-               char *tmp_str;
-
-               /* Convert -> int and back to string for security's sake since
-                * strtol() ignores leading and trailing characters.
-                */
-               errno = 0;
-               tmp_int = strtol (value, NULL, 10);
-               if (errno == 0) {
-                       tmp_str = g_strdup_printf ("%ld", tmp_int);
-                       //write_config_option (info->fd, "%s %s\n", (char *) key, tmp_str);
-                       g_free (tmp_str);
-               } else {
-                       g_set_error (&info->error,
-                                    NM_VPN_PLUGIN_ERROR,
-                                    NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
-                                    "Config option '%s' not an integer.",
-                                    (const char *) key);
-               }
        } else if (type == G_TYPE_NONE) {
                /* ignored */
        } else {
@@ -574,11 +533,7 @@ static gboolean
 nm_openswan_config_secret_write (NMSettingVPN *s_vpn, GError **error)
 {
        WriteConfigInfo *info;
-       //const char *props_username;
-       //const char *default_username;
        const char *pw_type;
-       //gint fdtmp1=-1;
-       //gint conf_fd=-1;
        gint secret_fd=-1;
 
        secret_fd = open ("/etc/ipsec.d/ipsec-nm-conn1.secrets", O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR);
@@ -699,19 +654,6 @@ real_need_secrets (NMVPNPlugin *plugin,
        return FALSE;
 }
 
-#if 0
-static gboolean
-ensure_killed (gpointer data)
-{
-       int pid = GPOINTER_TO_INT (data);
-
-       if (kill (pid, 0) == 0)
-               kill (pid, SIGKILL);
-
-       return FALSE;
-}
-#endif
-
 static gboolean
 real_disconnect (NMVPNPlugin   *plugin,
                          GError       **error)


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