patch-pppd_auth_c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. --- ppp-2.4.5.orig/pppd/auth.c 2009-11-16 23:26:07.000000000 +0100
  2. +++ ppp-2.4.5/pppd/auth.c 2014-03-17 16:13:14.000000000 +0100
  3. @@ -161,38 +161,38 @@ static int passwd_from_file;
  4. static bool default_auth;
  5. /* Hook to enable a plugin to control the idle time limit */
  6. -int (*idle_time_hook) __P((struct ppp_idle *)) = NULL;
  7. +int (*idle_time_hook) (struct ppp_idle *) = NULL;
  8. /* Hook for a plugin to say whether we can possibly authenticate any peer */
  9. -int (*pap_check_hook) __P((void)) = NULL;
  10. +int (*pap_check_hook) (void) = NULL;
  11. /* Hook for a plugin to check the PAP user and password */
  12. -int (*pap_auth_hook) __P((char *user, char *passwd, char **msgp,
  13. +int (*pap_auth_hook) (char *user, char *passwd, char **msgp,
  14. struct wordlist **paddrs,
  15. - struct wordlist **popts)) = NULL;
  16. + struct wordlist **popts) = NULL;
  17. /* Hook for a plugin to know about the PAP user logout */
  18. -void (*pap_logout_hook) __P((void)) = NULL;
  19. +void (*pap_logout_hook) (void) = NULL;
  20. /* Hook for a plugin to get the PAP password for authenticating us */
  21. -int (*pap_passwd_hook) __P((char *user, char *passwd)) = NULL;
  22. +int (*pap_passwd_hook) (char *user, char *passwd) = NULL;
  23. /* Hook for a plugin to say if we can possibly authenticate a peer using CHAP */
  24. -int (*chap_check_hook) __P((void)) = NULL;
  25. +int (*chap_check_hook) (void) = NULL;
  26. /* Hook for a plugin to get the CHAP password for authenticating us */
  27. -int (*chap_passwd_hook) __P((char *user, char *passwd)) = NULL;
  28. +int (*chap_passwd_hook) (char *user, char *passwd) = NULL;
  29. /* Hook for a plugin to say whether it is OK if the peer
  30. refuses to authenticate. */
  31. -int (*null_auth_hook) __P((struct wordlist **paddrs,
  32. - struct wordlist **popts)) = NULL;
  33. +int (*null_auth_hook) (struct wordlist **paddrs,
  34. + struct wordlist **popts) = NULL;
  35. -int (*allowed_address_hook) __P((u_int32_t addr)) = NULL;
  36. +int (*allowed_address_hook) (u_int32_t addr) = NULL;
  37. #ifdef HAVE_MULTILINK
  38. /* Hook for plugin to hear when an interface joins a multilink bundle */
  39. -void (*multilink_join_hook) __P((void)) = NULL;
  40. +void (*multilink_join_hook) (void) = NULL;
  41. #endif
  42. /* A notifier for when the peer has authenticated itself,
  43. @@ -241,37 +241,37 @@ char remote_name[MAXNAMELEN]; /* Peer's
  44. static char *uafname; /* name of most recent +ua file */
  45. -extern char *crypt __P((const char *, const char *));
  46. +extern char *crypt (const char *, const char *);
  47. /* Prototypes for procedures local to this file. */
  48. -static void network_phase __P((int));
  49. -static void check_idle __P((void *));
  50. -static void connect_time_expired __P((void *));
  51. -static int null_login __P((int));
  52. -static int get_pap_passwd __P((char *));
  53. -static int have_pap_secret __P((int *));
  54. -static int have_chap_secret __P((char *, char *, int, int *));
  55. -static int have_srp_secret __P((char *client, char *server, int need_ip,
  56. - int *lacks_ipp));
  57. -static int ip_addr_check __P((u_int32_t, struct permitted_ip *));
  58. -static int scan_authfile __P((FILE *, char *, char *, char *,
  59. +static void network_phase (int);
  60. +static void check_idle (void *);
  61. +static void connect_time_expired (void *);
  62. +static int null_login (int);
  63. +static int get_pap_passwd (char *);
  64. +static int have_pap_secret (int *);
  65. +static int have_chap_secret (char *, char *, int, int *);
  66. +static int have_srp_secret (char *client, char *server, int need_ip,
  67. + int *lacks_ipp);
  68. +static int ip_addr_check (u_int32_t, struct permitted_ip *);
  69. +static int scan_authfile (FILE *, char *, char *, char *,
  70. struct wordlist **, struct wordlist **,
  71. - char *, int));
  72. -static void free_wordlist __P((struct wordlist *));
  73. -static void auth_script __P((char *));
  74. -static void auth_script_done __P((void *));
  75. -static void set_allowed_addrs __P((int, struct wordlist *, struct wordlist *));
  76. -static int some_ip_ok __P((struct wordlist *));
  77. -static int setupapfile __P((char **));
  78. -static int privgroup __P((char **));
  79. -static int set_noauth_addr __P((char **));
  80. -static int set_permitted_number __P((char **));
  81. -static void check_access __P((FILE *, char *));
  82. -static int wordlist_count __P((struct wordlist *));
  83. + char *, int);
  84. +static void free_wordlist (struct wordlist *);
  85. +static void auth_script (char *);
  86. +static void auth_script_done (void *);
  87. +static void set_allowed_addrs (int, struct wordlist *, struct wordlist *);
  88. +static int some_ip_ok (struct wordlist *);
  89. +static int setupapfile (char **);
  90. +static int privgroup (char **);
  91. +static int set_noauth_addr (char **);
  92. +static int set_permitted_number (char **);
  93. +static void check_access (FILE *, char *);
  94. +static int wordlist_count (struct wordlist *);
  95. #ifdef MAXOCTETS
  96. -static void check_maxoctets __P((void *));
  97. +static void check_maxoctets (void *);
  98. #endif
  99. /*