- fixes for compile time errors

This commit is contained in:
Avesh Agarwal 2011-02-16 12:43:04 -05:00
parent 8783eae6ae
commit d3c0788252
2 changed files with 95 additions and 1 deletions

View File

@ -6,7 +6,7 @@
Summary: NetworkManager VPN plug-in for openswan
Name: NetworkManager-openswan
Version: 0.8.0
Release: 7%{snapshot}%{?dist}
Release: 8%{snapshot}%{?dist}
License: GPLv2+
Group: System Environment/Base
URL: http://people.redhat.com/avagarwa/files/NetworkManager-openswan/
@ -20,6 +20,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Patch1: nm-secret-whack.patch
Patch2: nm-616910.patch
Patch3: nm-changes.patch
Patch4: compile-errors.patch
BuildRequires: gtk2-devel
#BuildRequires: dbus-devel
@ -44,6 +45,7 @@ with NetworkManager and the GNOME desktop
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
%configure --disable-static --enable-more-warnings=yes
@ -77,6 +79,9 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_datadir}/gnome-vpn-properties/openswan
%changelog
* Wed Feb 16 2011 Avesh Agarwal <avagarwa@redhat.com> - 0.8.0-8.20100411git
- fixes for compile time errors
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.0-7.20100411git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

89
compile-errors.patch Normal file
View File

@ -0,0 +1,89 @@
diff -urNp NetworkManager-openswan-0.8-cvs-patched/auth-dialog/main.c NetworkManager-openswan-0.8-current/auth-dialog/main.c
--- NetworkManager-openswan-0.8-cvs-patched/auth-dialog/main.c 2011-02-15 10:56:52.192317259 -0500
+++ NetworkManager-openswan-0.8-current/auth-dialog/main.c 2011-02-16 12:27:03.016111821 -0500
@@ -284,7 +284,6 @@ main (int argc, char *argv[])
char *password = NULL, *group_password = NULL;
char *upw_type = NULL, *gpw_type = NULL;
char buf[1];
- int ret;
GError *error = NULL;
GOptionContext *context;
GOptionEntry entries[] = {
@@ -357,6 +356,9 @@ main (int argc, char *argv[])
fflush (stdout);
/* wait for data on stdin */
- ret = fread (buf, sizeof (char), sizeof (buf), stdin);
+ if (fread (buf, sizeof (char), sizeof (buf), stdin) < sizeof(buf) && ferror(stdin)) {
+ fprintf(stderr,"error occured when reading from stdin in main.c in auth-dialog");
+ }
+
return 0;
}
diff -urNp NetworkManager-openswan-0.8-cvs-patched/properties/nm-openswan.c NetworkManager-openswan-0.8-current/properties/nm-openswan.c
--- NetworkManager-openswan-0.8-cvs-patched/properties/nm-openswan.c 2011-02-15 10:57:24.704317823 -0500
+++ NetworkManager-openswan-0.8-current/properties/nm-openswan.c 2011-02-16 12:27:47.200862374 -0500
@@ -261,7 +261,6 @@ pw_type_changed_helper (OpenswanPluginUi
OpenswanPluginUiWidgetPrivate *priv = OPENSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
const char *entry = NULL;
GtkWidget *widget;
- GtkTreeModel *model;
/* If the user chose "Not required", desensitize and clear the correct
* password entry.
@@ -280,7 +279,7 @@ pw_type_changed_helper (OpenswanPluginUi
widget = glade_xml_get_widget (priv->xml, entry);
g_assert (widget);
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
+ gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
switch (gtk_combo_box_get_active (GTK_COMBO_BOX (combo))) {
case PW_TYPE_ASK:
case PW_TYPE_UNUSED:
@@ -488,11 +487,10 @@ static guint32
handle_one_pw_type (NMSettingVPN *s_vpn, GladeXML *xml, const char *name, const char *key)
{
GtkWidget *widget;
- GtkTreeModel *model;
guint32 pw_type;
widget = glade_xml_get_widget (xml, name);
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
+ gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
pw_type = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
switch (pw_type) {
@@ -617,12 +615,11 @@ save_one_password (GladeXML *xml,
GnomeKeyringResult ret;
GtkWidget *widget;
const char *password;
- GtkTreeModel *model;
gboolean saved = FALSE;
widget = glade_xml_get_widget (xml, combo);
g_assert (widget);
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
+ gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
if (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)) == PW_TYPE_SAVE) {
widget = glade_xml_get_widget (xml, entry);
g_assert (widget);
diff -urNp NetworkManager-openswan-0.8-cvs-patched/src/nm-openswan-service.c NetworkManager-openswan-0.8-current/src/nm-openswan-service.c
--- NetworkManager-openswan-0.8-cvs-patched/src/nm-openswan-service.c 2011-02-15 10:57:21.422336210 -0500
+++ NetworkManager-openswan-0.8-current/src/nm-openswan-service.c 2011-02-16 12:32:50.003111577 -0500
@@ -379,11 +379,14 @@ write_config_option (int fd, const char
{
char * string;
va_list args;
- int x;
va_start (args, format);
string = g_strdup_vprintf (format, args);
- x = write (fd, string, strlen (string));
+
+ if ( write (fd, string, strlen (string)) == -1) {
+ nm_warning ("nm-openswan: error in write_config_option");
+ }
+
g_free (string);
va_end (args);
}