radius.patch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. --- include/log.h.orig Tue Mar 19 15:32:00 2002
  2. +++ include/log.h Fri Jun 13 10:52:25 2003
  3. @@ -111,7 +111,7 @@
  4. void initlog(char*);
  5. void radlog_open(int category);
  6. void radlog_close();
  7. -void radlog(/*int, char *, ...*/);
  8. +void radlog(int, char *, ...);
  9. int __insist_failure(char *, char *, int);
  10. /* Debugging facilities */
  11. @@ -137,7 +137,7 @@
  12. #endif
  13. void _debug_print(char *file, int line, char *func_name, char *str);
  14. -char *_debug_format_string(/* char *fmt, ... */);
  15. +char *_debug_format_string(char *fmt, ... );
  16. /* Parsing */
  17. --- include/radiusd.h.orig Mon Aug 5 15:25:12 2002
  18. +++ include/radiusd.h Fri Jun 13 10:56:16 2003
  19. @@ -166,9 +166,9 @@
  20. #define stat_inc(m,a,c) \
  21. do {\
  22. NAS *nas;\
  23. - server_stat->##m . ##c ++;\
  24. + server_stat->m.c++;\
  25. if ((nas = nas_lookup_ip(a)) != NULL && nas->app_data)\
  26. - ((struct nas_stat*)nas->app_data)-> ##m . ##c ++;\
  27. + ((struct nas_stat*)nas->app_data)->m.c++;\
  28. } while (0)
  29. extern struct radstat radstat;
  30. --- include/display.h.orig Tue Mar 19 15:32:00 2002
  31. +++ include/display.h Fri Jun 13 11:00:09 2003
  32. @@ -34,4 +34,4 @@
  33. void scroll(int);
  34. void page(int);
  35. void clearmsg();
  36. -int msg();
  37. +int msg(int, char *, ...);
  38. --- radlib/debug.c.orig Tue Mar 19 15:32:02 2002
  39. +++ radlib/debug.c Fri Jun 13 10:40:36 2003
  40. @@ -31,7 +31,7 @@
  41. #include <stdio.h>
  42. #include <stdlib.h>
  43. #include <unistd.h>
  44. -#include <varargs.h>
  45. +#include <stdarg.h>
  46. #include <time.h>
  47. #include <errno.h>
  48. #include <string.h>
  49. --- radlib/logger.c.orig Tue Mar 19 15:32:02 2002
  50. +++ radlib/logger.c Fri Jun 13 10:53:05 2003
  51. @@ -27,7 +27,7 @@
  52. #include <stdio.h>
  53. #include <stdlib.h>
  54. #include <unistd.h>
  55. -#include <varargs.h>
  56. +#include <stdarg.h>
  57. #include <time.h>
  58. #include <errno.h>
  59. #include <string.h>
  60. @@ -35,36 +35,27 @@
  61. /*PRINTFLIKE2*/
  62. void
  63. -radlog(lvl, msg, va_alist)
  64. - int lvl;
  65. - char *msg;
  66. - va_dcl
  67. +radlog(int lvl, char *msg, ...)
  68. {
  69. va_list ap;
  70. int ec = 0;
  71. if (lvl & L_PERROR)
  72. ec = errno;
  73. - va_start(ap);
  74. + va_start(ap, msg);
  75. vlog(lvl, NULL, 0, NULL, ec, msg, ap);
  76. va_end(ap);
  77. }
  78. void
  79. -_dolog(level, file, line, func_name, fmt, va_alist)
  80. - int level;
  81. - char *file;
  82. - int line;
  83. - char *func_name;
  84. - char *fmt;
  85. - va_dcl
  86. +_dolog(int level, char *file, int line, char *func_name, char *fmt, ...)
  87. {
  88. va_list ap;
  89. int ec = 0;
  90. if (level & L_PERROR)
  91. ec = errno;
  92. - va_start(ap);
  93. + va_start(ap, fmt);
  94. vlog(level, file, line, func_name, ec, fmt, ap);
  95. va_end(ap);
  96. }
  97. @@ -81,15 +72,12 @@
  98. }
  99. char *
  100. -_debug_format_string(va_alist)
  101. - va_dcl
  102. +_debug_format_string(char *fmt, ...)
  103. {
  104. va_list ap;
  105. - char *fmt;
  106. char *str = NULL;
  107. - va_start(ap);
  108. - fmt = va_arg(ap,char*);
  109. + va_start(ap, fmt);
  110. vasprintf(&str, fmt, ap);
  111. va_end(ap);
  112. return str;
  113. --- radlib/applog.c.orig Tue Mar 19 15:32:02 2002
  114. +++ radlib/applog.c Fri Jun 13 10:53:43 2003
  115. @@ -27,7 +27,7 @@
  116. #include <stdio.h>
  117. #include <stdlib.h>
  118. #include <unistd.h>
  119. -#include <varargs.h>
  120. +#include <stdarg.h>
  121. #include <time.h>
  122. #include <errno.h>
  123. #include <string.h>
  124. --- radiusd/log.c.orig Tue Mar 19 15:32:00 2002
  125. +++ radiusd/log.c Fri Jun 13 10:56:47 2003
  126. @@ -23,7 +23,7 @@
  127. #include <stdlib.h>
  128. #include <unistd.h>
  129. #include <errno.h>
  130. -#include <varargs.h>
  131. +#include <stdarg.h>
  132. #include <syslog.h>
  133. #include <radiusd.h>
  134. #include <log.h>
  135. --- radiusd/rewrite.y.orig Wed Jul 31 13:56:18 2002
  136. +++ radiusd/rewrite.y Fri Jun 13 10:57:52 2003
  137. @@ -28,7 +28,7 @@
  138. #include <radiusd.h>
  139. #include <symtab.h>
  140. #include <setjmp.h>
  141. -#include <varargs.h>
  142. +#include <stdarg.h>
  143. #include <obstack1.h>
  144. #include <argcv.h>
  145. #include <rewrite.h>
  146. @@ -4590,11 +4590,7 @@
  147. /*VARARGS3*/
  148. int
  149. -va_run_init(name, request, typestr, va_alist)
  150. - char *name;
  151. - VALUE_PAIR *request;
  152. - char *typestr;
  153. - va_dcl
  154. +va_run_init(char *name, VALUE_PAIR *request, char *typestr, ...)
  155. {
  156. FILE *fp;
  157. va_list ap;
  158. @@ -4626,7 +4622,7 @@
  159. /* Pass arguments */
  160. nargs = 0;
  161. - va_start(ap);
  162. + va_start(ap, typestr);
  163. while (*typestr) {
  164. nargs++;
  165. switch (*typestr++) {
  166. --- radiusd/snmpserv.c.orig Tue Mar 19 15:32:00 2002
  167. +++ radiusd/snmpserv.c Fri Jun 13 10:58:11 2003
  168. @@ -28,7 +28,7 @@
  169. #include <sys/types.h>
  170. #include <sys/socket.h>
  171. -#include <varargs.h>
  172. +#include <stdarg.h>
  173. #include <asn1.h>
  174. #include <snmp.h>
  175. #include <mib.h>
  176. --- raduse/raduse.c.orig Wed Mar 20 12:35:13 2002
  177. +++ raduse/raduse.c Fri Jun 13 10:58:40 2003
  178. @@ -60,7 +60,7 @@
  179. PORT_STAT *port;
  180. } port_usage_t;
  181. -#define AP(p,m) (((port_usage_t*)(p)->app_data)-> ##m)
  182. +#define AP(p,m) (((port_usage_t*)(p)->app_data)->m)
  183. /* various options */
  184. int width = 5; /* width for time output (5 - hh:mm, 8 - hh:mm:ss) */
  185. --- raduse/display.c.orig Tue Mar 19 15:32:04 2002
  186. +++ raduse/display.c Fri Jun 13 11:00:10 2003
  187. @@ -26,7 +26,7 @@
  188. #include <stdio.h>
  189. #include <stdlib.h>
  190. #include <unistd.h>
  191. -#include <varargs.h>
  192. +#include <stdarg.h>
  193. #include <ctype.h>
  194. #include <log.h>
  195. #include <mem.h>
  196. @@ -139,16 +139,13 @@
  197. /*VARARGS2*/
  198. -msg(type, msgfmt, va_alist)
  199. - int type;
  200. - char *msgfmt;
  201. - va_dcl
  202. +int msg(int type, char *msgfmt, ...)
  203. {
  204. register int i;
  205. va_list ap;
  206. char next_msg[128];
  207. - va_start(ap);
  208. + va_start(ap, msgfmt);
  209. next_msg[0] = ' ';
  210. i = 1 + vsprintf(next_msg+1, msgfmt, ap);
  211. --- radtest/gram.y.orig Wed Aug 14 16:11:13 2002
  212. +++ radtest/gram.y Fri Jun 13 11:00:49 2003
  213. @@ -41,7 +41,7 @@
  214. #include <signal.h>
  215. #include <errno.h>
  216. #include <sys/wait.h>
  217. -#include <varargs.h>
  218. +#include <stdarg.h>
  219. #include <sysdep.h>
  220. #include <radius.h>
  221. #include <radclient.h>
  222. @@ -368,14 +368,11 @@
  223. }
  224. void
  225. -parse_error(va_alist)
  226. - va_dcl
  227. +parse_error(char *fmt, ...)
  228. {
  229. va_list ap;
  230. - char *fmt;
  231. - va_start(ap);
  232. - fmt = va_arg(ap, char*);
  233. + va_start(ap, fmt);
  234. fprintf(stderr, "%s:%d: ", source_filename, source_line_num);
  235. vfprintf(stderr, fmt, ap);
  236. va_end(ap);
  237. --- radtest/radtest.h.orig Tue Mar 19 15:32:04 2002
  238. +++ radtest/radtest.h Fri Jun 13 11:01:07 2003
  239. @@ -69,7 +69,7 @@
  240. int open_input(char *name);
  241. void close_input();
  242. void set_yydebug();
  243. -void parse_error();
  244. +void parse_error(char *fmt, ...);
  245. void print(Variable *var);
  246. void radtest_send(int port, int code, Variable *var);
  247. void putback(char *str);