Bug 8077 - wvdial incorrectly builds pppd'd argv
Summary: wvdial incorrectly builds pppd'd argv
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: wvdial
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-12-31 00:53 UTC by Christian Hechelmann
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-01-18 15:36:34 UTC
Embargoed:


Attachments (Terms of Use)

Description Christian Hechelmann 1999-12-31 00:53:05 UTC
wvdial does not correctly build the argv array to exec pppd. Depending on
the configuration of the dialer section to be called the argv array
contains NULL argument pointers followed by non NULL arguemnt pointers
(specifically an unset remote_name causes this bug to show). This argv
is passed unchanged to execvp(). Since exec*() stops on the first NULL in
the argument array the arguments follwing the first NULL are never passed
to pppd (which means ppp never sees "call wvdial" and all (new) connections
fail (at least in my case)).

This Problem applies to rp3 also since it uses the same code from wvdial.

Patch file will be attached to this bug report.

Comment 1 Christian Hechelmann 1999-12-31 01:15:59 UTC
Since createattachment.cgi always fails with "no file provided or file emtpy"
here we go:

--- wvdial-1.40/wvdial/wvdialer.cc.braindamage  Fri Dec 31 00:36:37 1999
+++ wvdial-1.40/wvdial/wvdialer.cc      Fri Dec 31 00:51:53 1999
@@ -595,6 +595,7 @@
 /************************/
 {
     WvString   addr_colon( "%s:", options.force_addr );
+    int i;

     char const *argv[] = {
        options.where_pppd,
@@ -605,12 +606,28 @@
        "-detach",
        "user", options.login,
        options.force_addr[0] ? (const char *)addr_colon : "noipdefault",
-       remote_name ? "remotename" : NULL,
-       remote_name ? remote_name : NULL,
-       options.new_pppd ? "call" : NULL,
-       options.new_pppd ? "wvdial" : NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
        NULL
     };
+
+    /* XXX FIXME: This is a gross hack but works */
+    /*            The older method did _not_ work since exec*() argv */
+    /*            parsing stops on the first NULL, so pppd never gets */
+    /*            "call wvdial" as arguemnts when no remote_name is */
+    /*            provided. Someone speaking C++ should have a look at this */
+    i = 8;
+    if(remote_name) {
+      argv[i++] = "remotename";
+      argv[i++] = remote_name;
+    }
+
+    if(options.new_pppd) {
+      argv[i++] = "call";
+      argv[i++] = "wvdial";
+    }

     if( !chat_mode && (access( options.where_pppd, X_OK ) != 0) ) {
         err( "Unable to run %s.\n", options.where_pppd );

Comment 2 Nalin Dahyabhai 2000-01-18 15:36:59 UTC
This should be fixed in wvdial-1.41-1, which is now in Raw Hide.


Note You need to log in before you can comment on or make changes to this bug.