summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Niemueller <tim@niemueller.de>2006-08-25 11:13:06 +0000
committerTim Niemueller <tim@niemueller.de>2006-08-25 11:13:06 +0000
commit15adb0ea447d1992a84c67f5fda2b6f0b384310e (patch)
tree0583f576878161eaa8c13602be6ceabc29b9cf2d
parent072849ef0982a9f4da58ebf24c60bf4e0c09e37a (diff)
downloadNetworkManager-15adb0ea447d1992a84c67f5fda2b6f0b384310e.tar.gz
2006-08-25 Tim Niemueller <tim@niemueller.de>
* patches/wvstreams-4.2.1-conffd.patch: Allow for opening a config file from an file descriptor (on non win32 systems) * patches/wvdial-1.54-cfgstdin.patch: This adds a flag --config-stdin which makes wvdial read the config file from stdin, will wait up to 10 seconds for data to arrive * patches/wvdial-1.54-pppdoptions.patch: Allow up to 10 pppd options instead of just one git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/branches/SoC_2006@2004 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-rw-r--r--patches/wvdial-1.54-cfgstdin.patch71
-rw-r--r--patches/wvdial-1.54-pppdoptions.patch54
-rw-r--r--patches/wvstreams-4.2.1-conffd.patch84
3 files changed, 209 insertions, 0 deletions
diff --git a/patches/wvdial-1.54-cfgstdin.patch b/patches/wvdial-1.54-cfgstdin.patch
new file mode 100644
index 0000000000..aa78593ff5
--- /dev/null
+++ b/patches/wvdial-1.54-cfgstdin.patch
@@ -0,0 +1,71 @@
+diff -ur wvdial-1.54.0/wvdial.1 wvdial-1.54.0.cfgstdin/wvdial.1
+--- wvdial-1.54.0/wvdial.1 2003-11-14 20:46:13.000000000 +0100
++++ wvdial-1.54.0.cfgstdin/wvdial.1 2006-07-18 17:55:09.000000000 +0200
+@@ -65,6 +65,11 @@
+ configurations, or you want to avoid having dial-up information (usernames,
+ passwords, calling card numbers, etc.) in a system wide configuration file.
+ .TP
++.I "\-\-config-stdin"
++Have wvdial read its configuration from stdin (instead of /etc/wvdial.conf).
++This is mainly useful if you do not want to put the configuration data to a file
++if you call wvdial from within another program context.
++.TP
+ .I "\-\-no-syslog"
+ Don't output debug information to the syslog daemon (only useful together
+ with --chat).
+diff -ur wvdial-1.54.0/wvdial.cc wvdial-1.54.0.cfgstdin/wvdial.cc
+--- wvdial-1.54.0/wvdial.cc 2003-11-14 20:46:13.000000000 +0100
++++ wvdial-1.54.0.cfgstdin/wvdial.cc 2006-07-26 13:09:39.000000000 +0200
+@@ -16,6 +16,8 @@
+
+ #include <signal.h>
+ #include <sys/wait.h>
++#include <sys/time.h>
++#include <sys/types.h>
+ #include <unistd.h>
+
+ volatile bool want_to_die = false;
+@@ -119,6 +121,30 @@
+ return 1;
+ }
+ }
++#ifndef _WIN32
++ if( !strcmp( argv[i], "--config-stdin" ) )
++ {
++ // wait up to 10 seconds for data
++ fd_set rfds;
++ struct timeval tv;
++ int retval = 1;
++ FD_ZERO(&rfds);
++ FD_SET(STDIN_FILENO, &rfds);
++ tv.tv_sec = 10;
++ tv.tv_usec = 0;
++ retval = select( STDIN_FILENO + 1, &rfds, NULL, NULL, &tv);
++ if ( retval > 0 ) {
++ // data has arrived
++ haveconfig = 1;
++ cfg.load_file( STDIN_FILENO );
++ continue;
++ } else {
++ // no config data
++ log("no config data could be read from stdin");
++ exit( 3 );
++ }
++ }
++#endif
+ if( strchr( argv[i], '=' ) ) {
+ havecmdlineopts = 1;
+ cmdlineopts.append(new WvString(argv[i]),true);
+Nur in wvdial-1.54.0.cfgstdin/: wvdial.cc~.
+diff -ur wvdial-1.54.0/wvdialtext.cc wvdial-1.54.0.cfgstdin/wvdialtext.cc
+--- wvdial-1.54.0/wvdialtext.cc 2003-11-14 20:46:13.000000000 +0100
++++ wvdial-1.54.0.cfgstdin/wvdialtext.cc 2006-07-18 18:16:09.000000000 +0200
+@@ -18,6 +18,7 @@
+ "\n"
+ " options: --config configfile use configfile instead of /etc/wvdial.conf\n"
+ " or $HOME/.wvdial.conf\n"
++" --config-stdin read config from stdin\n"
+ " --chat used when running wvdial from pppd\n"
+ " --help display this help and exit\n"
+ " --version output version information and exit\n"
+Nur in wvdial-1.54.0.cfgstdin/: wvdialtext.cc~.
diff --git a/patches/wvdial-1.54-pppdoptions.patch b/patches/wvdial-1.54-pppdoptions.patch
new file mode 100644
index 0000000000..00a7dd2ff5
--- /dev/null
+++ b/patches/wvdial-1.54-pppdoptions.patch
@@ -0,0 +1,54 @@
+diff -urN wvdial-1.54.0/wvdialer.cc wvdial-1.54.0.tn/wvdialer.cc
+--- wvdial-1.54.0/wvdialer.cc 2003-11-14 20:46:13.000000000 +0100
++++ wvdial-1.54.0.tn/wvdialer.cc 2006-07-18 12:20:02.000000000 +0200
+@@ -601,6 +601,15 @@
+ { "Password Prompt", &options.pass_prompt, NULL, "", 0 },
+ { "PPPD Path", &options.where_pppd, NULL, "/usr/sbin/pppd", 0 },
+ { "PPPD Option", &options.pppd_option, NULL, "", 0 },
++ { "PPPD Option 1", &options.pppd_option1, NULL, "", 0 },
++ { "PPPD Option 2", &options.pppd_option2, NULL, "", 0 },
++ { "PPPD Option 3", &options.pppd_option3, NULL, "", 0 },
++ { "PPPD Option 4", &options.pppd_option4, NULL, "", 0 },
++ { "PPPD Option 5", &options.pppd_option5, NULL, "", 0 },
++ { "PPPD Option 6", &options.pppd_option6, NULL, "", 0 },
++ { "PPPD Option 7", &options.pppd_option7, NULL, "", 0 },
++ { "PPPD Option 8", &options.pppd_option8, NULL, "", 0 },
++ { "PPPD Option 9", &options.pppd_option9, NULL, "", 0 },
+ { "Force Address", &options.force_addr, NULL, "", 0 },
+ { "Remote Name", &options.remote, NULL, "*", 0 },
+ { "Default Reply", &options.default_reply,NULL, "ppp", 0 },
+@@ -1205,6 +1214,15 @@
+ options.new_pppd && options.auto_dns ? "usepeerdns" : NULL,
+ options.new_pppd && options.isdn ? "default-asyncmap" : NULL,
+ options.new_pppd && options.pppd_option[0] ? (const char *) options.pppd_option : NULL,
++ options.new_pppd && options.pppd_option1[0] ? (const char *) options.pppd_option1 : NULL,
++ options.new_pppd && options.pppd_option2[0] ? (const char *) options.pppd_option2 : NULL,
++ options.new_pppd && options.pppd_option3[0] ? (const char *) options.pppd_option3 : NULL,
++ options.new_pppd && options.pppd_option4[0] ? (const char *) options.pppd_option4 : NULL,
++ options.new_pppd && options.pppd_option5[0] ? (const char *) options.pppd_option5 : NULL,
++ options.new_pppd && options.pppd_option6[0] ? (const char *) options.pppd_option6 : NULL,
++ options.new_pppd && options.pppd_option7[0] ? (const char *) options.pppd_option7 : NULL,
++ options.new_pppd && options.pppd_option8[0] ? (const char *) options.pppd_option8 : NULL,
++ options.new_pppd && options.pppd_option9[0] ? (const char *) options.pppd_option9 : NULL,
+ options.new_pppd && options.idle_seconds >= 0 ? "idle" : NULL,
+ options.new_pppd && options.idle_seconds >= 0 ? (const char *)idle_seconds : NULL,
+ "logfd", buffer1,
+diff -urN wvdial-1.54.0/wvdialer.h wvdial-1.54.0.tn/wvdialer.h
+--- wvdial-1.54.0/wvdialer.h 2003-11-14 20:46:13.000000000 +0100
++++ wvdial-1.54.0.tn/wvdialer.h 2006-07-18 12:20:58.000000000 +0200
+@@ -112,6 +112,15 @@
+ WvString pass_prompt;
+ WvString where_pppd;
+ WvString pppd_option;
++ WvString pppd_option1;
++ WvString pppd_option2;
++ WvString pppd_option3;
++ WvString pppd_option4;
++ WvString pppd_option5;
++ WvString pppd_option6;
++ WvString pppd_option7;
++ WvString pppd_option8;
++ WvString pppd_option9;
+ WvString force_addr;
+ WvString remote;
+ WvString default_reply;
diff --git a/patches/wvstreams-4.2.1-conffd.patch b/patches/wvstreams-4.2.1-conffd.patch
new file mode 100644
index 0000000000..47ff14781f
--- /dev/null
+++ b/patches/wvstreams-4.2.1-conffd.patch
@@ -0,0 +1,84 @@
+diff -ur wvstreams-4.2.1/configfile/wvconf.cc wvstreams-4.2.1.conffd/configfile/wvconf.cc
+--- wvstreams-4.2.1/configfile/wvconf.cc 2005-11-17 21:44:57.000000000 +0100
++++ wvstreams-4.2.1.conffd/configfile/wvconf.cc 2006-07-26 12:29:18.000000000 +0200
+@@ -173,16 +173,14 @@
+ setint(section, entry, value);
+ }
+
+-
+-void WvConf::load_file(WvStringParm filename)
++void
++WvConf::load_file(WvFile &file)
+ {
+ char *p;
+ char *from_file;
+ WvConfigSection *sect = &globalsection;
+ bool quick_mode = false;
+
+- WvFile file(filename, O_RDONLY);
+-
+ #ifdef _WIN32
+ //FIXME: Windows doesn't have a sticky bit so we can't use that to signal other processes that
+ // the file is being written to. Just be careful :).
+@@ -199,7 +197,7 @@
+ {
+ file.close();
+ file.seterr(EAGAIN);
+- }
++ }
+ #endif
+
+ if (!file.isok())
+@@ -215,7 +213,7 @@
+
+ while ((from_file = trim_string(file.getline())) != NULL)
+ {
+-
++ printf("Read from file: %s\n", from_file);
+ if ((p = parse_section(from_file)) != NULL)
+ {
+ quick_mode = false;
+@@ -257,6 +255,21 @@
+ loaded_once = true;
+ }
+
++
++void WvConf::load_file(WvStringParm filename)
++{
++ WvFile file(filename, O_RDONLY);
++ load_file( file );
++}
++
++#ifndef _WIN32 // since win32 doesn't support fcntl
++void WvConf::load_file(int rwfd)
++{
++ WvFile file( rwfd );
++ load_file( file );
++}
++#endif
++
+
+ WvConf::~WvConf()
+ {
+diff -ur wvstreams-4.2.1/include/wvconf.h wvstreams-4.2.1.conffd/include/wvconf.h
+--- wvstreams-4.2.1/include/wvconf.h 2005-11-17 21:45:04.000000000 +0100
++++ wvstreams-4.2.1.conffd/include/wvconf.h 2006-07-18 17:56:12.000000000 +0200
+@@ -17,6 +17,7 @@
+ #include "wvlog.h"
+ #include "wvstringlist.h"
+ #include "wvcallback.h"
++#include "wvfile.h"
+
+
+ #ifdef __WVCONFEMU_H
+@@ -194,6 +195,10 @@
+ void load_file() // append the contents of the real config file
+ { load_file(filename); }
+ void load_file(WvStringParm filename); // append any config file
++ void load_file(WvFile &file); // append any config file
++#ifndef _WIN32
++ void load_file(int rwfd); // append any config file
++#endif
+
+ // Gets a user's password and decrypts it. This isn't defined in wvconf.cc.
+ WvString get_passwd(WvStringParm sect, WvStringParm user);