Bug 8077 - wvdial incorrectly builds pppd'd argv
wvdial incorrectly builds pppd'd argv
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: wvdial (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-12-30 19:53 EST by Christian Hechelmann
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-18 10:36:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christian Hechelmann 1999-12-30 19:53:05 EST
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-30 20:15:59 EST
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 10:36:59 EST
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.