Hi, 

I am writing some cgi software to allow users to manage ppp links on a
closit gateway machine.  One feature I need is the ability to use a user
supplied password to send as the PAP authentication token.

In previous versions of ppp, I have written my own patches, but every
version has significant changes, which means that I have to re-work my
patch.

This problem is now solved as I have now put it in a plugin.  (Plugins are
a great idea!)

The problem I am having is that ppp is not working.  I am not sure where
the problem is.

My questions are then:
Does ppp-2.3.10 work with kernel 2.2.13?

Is there a problem with my plugin? (see below).  It compiles, loads and
reads the password, but as soon as the link attempts to start, I get a
signal 11 and everything dies.

Here is the plugin.
    11  #include <stddef.h>
    12  #include <time.h>
    13  #include "pppd.h"
    14
    15  int attempt_auth = 0;
    16
    17  char jn_authpass[MAXSECRETLEN] = "";
    18
    19  static int authpass __P((char **));
    20
    21  static option_t my_options[] = {
    22      {"authpass", o_special_noarg, authpass,
    23       "read password from stdin"},
    24     { NULL }
    25  };
    26
    27  static int my_pap_passwd_hook(char *user, char *passwd)
    28  {
    29     // copy the password into passwd
    30
    31     if(attempt_auth)
    32     {
    33        strncpy(passwd, jn_authpass, MAXSECRETLEN);
    34        return 0;
    35     }
    36     else
    37     {
    38        return -1;
    39     }
    40
    41  }
    42
    43  void plugin_init(void)
    44  {
    45     info("plugin_init");
    46     add_options(my_options);
    47
    48     // hook the auth functions...
    49     //idle_time_hook = my_get_idle;
    50     pap_passwd_hook = my_pap_passwd_hook;
    51  }
    52
    53  static int authpass(argv) char **argv;
    54  {
    55          int i;
    56     info("authpass");
    57
    58          fgets(jn_authpass, MAXNAMELEN, stdin);
    59
    60          // we have to get rid of the new line in the string....
    61          for(i=0; i<MAXNAMELEN; i++)
    62          {
    63                  if(jn_authpass[i] == '\n')
    64                  {
    65                          jn_authpass[i] = 0;
    66                  }
    67          }
    68          attempt_auth = 1;
    69          return 1;
    70  }
    71

Any help would be much appreciated.
Please e-mail me with any reply, as I am not on the list.

P.S.  Who is the ppp maintainer? I can't seem to find them anywhere.
A feature such as I am trying to add seems to be very useful, I am
supprised that it is not present.

Thanks, 
John.

--
http://uranus.it.swin.edu.au/~jn/linux/



-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to [EMAIL PROTECTED]

Reply via email to