Advertisement
uaa

[wip:20221204] canna35-diff

uaa
Dec 3rd, 2022
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.60 KB | None | 0 0
  1. Index: Makefile
  2. ===================================================================
  3. RCS file: /cvs/ports/japanese/canna/Makefile,v
  4. retrieving revision 1.42
  5. diff -u -p -r1.42 Makefile
  6. --- Makefile 11 Mar 2022 19:24:42 -0000 1.42
  7. +++ Makefile 4 Dec 2022 04:20:12 -0000
  8. @@ -10,7 +10,7 @@ PKGNAME-server= cannaserver-3.5b2
  9.  
  10. REVISION-main = 6
  11. REVISION-dict = 1
  12. -REVISION-server = 8
  13. +REVISION-server = 9
  14.  
  15. SHARED_LIBS= RKC 1.0 \
  16. RKC16 1.0 \
  17. Index: patches/patch-server_misc_c
  18. ===================================================================
  19. RCS file: /cvs/ports/japanese/canna/patches/patch-server_misc_c,v
  20. retrieving revision 1.2
  21. diff -u -p -r1.2 patch-server_misc_c
  22. --- patches/patch-server_misc_c 11 Mar 2022 19:24:42 -0000 1.2
  23. +++ patches/patch-server_misc_c 4 Dec 2022 04:20:12 -0000
  24. @@ -1,5 +1,19 @@
  25. ---- server/misc.c.orig Mon Jul 3 17:58:30 2000
  26. -+++ server/misc.c Mon Jul 3 18:01:42 2000
  27. +--- server/misc.c.orig Wed Nov 27 16:30:30 1996
  28. ++++ server/misc.c Sun Dec 4 06:35:49 2022
  29. +@@ -471,5 +471,5 @@ CreateAccessControlList()
  30. + hp = gethostbyname(MyName);
  31. + if (hp) {
  32. +- MyAddr = *(unsigned long *)(hp->h_addr);
  33. ++ MyAddr = *(unsigned int *)(hp->h_addr);
  34. + }
  35. +
  36. +@@ -527,5 +527,5 @@ CreateAccessControlList()
  37. + continue;
  38. + }
  39. +- current->hostaddr = *(unsigned long *)(hp->h_addr);
  40. ++ current->hostaddr = *(unsigned int *)(hp->h_addr);
  41. + /* 複数のアドレスが入っていることに対応していないなあ */
  42. +
  43. @@ -650,17 +650,19 @@ int cxnum ;
  44. if (client->username && client->username[0]) {
  45. if (client->groupname && client->groupname[0]) {
  46. Index: patches/patch-server_wconvert_c
  47. ===================================================================
  48. RCS file: /cvs/ports/japanese/canna/patches/patch-server_wconvert_c,v
  49. retrieving revision 1.2
  50. diff -u -p -r1.2 patch-server_wconvert_c
  51. --- patches/patch-server_wconvert_c 11 Mar 2022 19:24:42 -0000 1.2
  52. +++ patches/patch-server_wconvert_c 4 Dec 2022 04:20:12 -0000
  53. @@ -1,12 +1,40 @@
  54. ---- server/wconvert.c.orig Wed Nov 27 02:27:28 1996
  55. -+++ server/wconvert.c Wed Mar 12 14:59:07 2003
  56. +--- server/wconvert.c.orig Wed Nov 27 16:27:28 1996
  57. ++++ server/wconvert.c Sun Dec 4 10:24:46 2022
  58. @@ -101,4 +101,5 @@ extern reqproc ExtensionWideVector[];
  59.  
  60. extern void DispDebug() ;
  61. +extern const Ushort *ushortmemchr pro((const Ushort *, int, size_t));
  62. extern int canna_server_hi ;
  63. extern int canna_server_lo ;
  64. -@@ -1323,5 +1324,8 @@ ClientPtr *clientp ;
  65. +@@ -668,4 +669,10 @@ irw_killserver(clientp)
  66. + }
  67. +
  68. ++ cli_hostaddr = client->hostaddr;
  69. ++ if (!cli_hostaddr){
  70. ++ /* unixドメインの場合(0)、通過ok */
  71. ++ goto finalize;
  72. ++ }
  73. ++
  74. + /* サーバ側のホストアドレスの取得 成功(0) */
  75. + if (gethostname(buf, sizeof(buf)) < 0){
  76. +@@ -676,9 +683,7 @@ irw_killserver(clientp)
  77. + goto not_addr;
  78. + }
  79. +- ser_hostaddr = *(unsigned long *)(ser->h_addr);
  80. +- cli_hostaddr = client->hostaddr;
  81. ++ ser_hostaddr = *(unsigned int *)(ser->h_addr);
  82. +
  83. + /* アドレスの比較 */
  84. +- if (cli_hostaddr) /* unixドメインの場合(0)、通過ok */
  85. + if (cli_hostaddr != ser_hostaddr){
  86. + not_addr:
  87. +@@ -688,4 +693,5 @@ irw_killserver(clientp)
  88. +
  89. + /* 終了処理 */
  90. ++finalize:
  91. + RkwFinalize();
  92. + SendType2Reply(client, wKillServer, !EXTPROTO, 0);
  93. +@@ -1323,5 +1329,8 @@ ClientPtr *clientp ;
  94. int cxnum = Request.type18.context, stat = -1;
  95. int requestsize = Request.type18.size, retval;
  96. + size_t datasize = Request.type18.datalen - SIZEOFSHORT * 2;
  97. @@ -15,13 +43,13 @@
  98. + goto protoerr;
  99. if (validcontext(cxnum, client, wListDictionary)) {
  100. if (requestsize <= sizeof(local_buffer) ||
  101. -@@ -1360,4 +1364,5 @@ ClientPtr *clientp ;
  102. +@@ -1360,4 +1369,5 @@ ClientPtr *clientp ;
  103. }
  104.  
  105. +protoerr:
  106. retval = SendType6Reply(client, wListDictionary, EXTPROTO, stat,
  107. dicnames, namesize(dicnames, stat));
  108. -@@ -1471,8 +1476,13 @@ ClientPtr *clientp ;
  109. +@@ -1471,8 +1481,13 @@ ClientPtr *clientp ;
  110. int cxnum = Request.type18.context, stat = BADCONT;
  111. int dirlen, requestsize = Request.type18.size, retval;
  112. + size_t datasize = Request.type18.datalen - SIZEOFSHORT * 2;
  113. @@ -35,13 +63,13 @@
  114. + goto protoerr;
  115. dicname = &(req->data[dirlen]) ;
  116. if (dirlen > 1) {
  117. -@@ -1516,4 +1526,5 @@ ClientPtr *clientp ;
  118. +@@ -1516,4 +1531,5 @@ ClientPtr *clientp ;
  119. }
  120. }
  121. +protoerr:
  122. retval = SendType7Reply(client, wGetWordTextDictionary, EXTPROTO,
  123. stat, stat > 0 ? stat + 1 : 0, infobuf);
  124. -@@ -2097,10 +2108,10 @@ ClientPtr *clientp;
  125. +@@ -2097,10 +2113,10 @@ ClientPtr *clientp;
  126.  
  127. if (validcontext(cxnum, client, wThrough)) {
  128. - buf = malloc((int)Request.type20.bufsize);
  129. @@ -55,7 +83,7 @@
  130. + buf, content_size, content_size);
  131. }
  132. }
  133. -@@ -2297,4 +2308,7 @@ BYTE *buf ;
  134. +@@ -2297,4 +2313,7 @@ BYTE *buf ;
  135. ir_debug( Dmsg(10, "ProcWideReq1 start!!\n") );
  136.  
  137. + if (Request.type1.datalen != 0)
  138. @@ -63,28 +91,28 @@
  139. +
  140. return( 0 ) ;
  141. }
  142. -@@ -2306,4 +2320,6 @@ BYTE *buf ;
  143. +@@ -2306,4 +2325,6 @@ BYTE *buf ;
  144. ir_debug( Dmsg(10, "ProcWideReq2 start!!\n") );
  145.  
  146. + if (Request.type2.datalen != SIZEOFSHORT)
  147. + return( -1 );
  148. buf += HEADER_SIZE; Request.type2.context = S2TOS(buf);
  149. ir_debug( Dmsg(10, "req->context =%d\n", Request.type2.context) );
  150. -@@ -2318,4 +2334,6 @@ BYTE *buf ;
  151. +@@ -2318,4 +2339,6 @@ BYTE *buf ;
  152. ir_debug( Dmsg(10, "ProcWideReq3 start!!\n") );
  153.  
  154. + if (Request.type3.datalen != SIZEOFSHORT * 2)
  155. + return( -1 );
  156. buf += HEADER_SIZE; Request.type3.context = S2TOS(buf);
  157. buf += SIZEOFSHORT; Request.type3.buflen = S2TOS(buf);
  158. -@@ -2335,4 +2353,6 @@ BYTE *buf ;
  159. +@@ -2335,4 +2358,6 @@ BYTE *buf ;
  160. ir_debug( Dmsg(10, "ProcWideReq4 start!!\n") );
  161.  
  162. + if (Request.type4.datalen < SIZEOFSHORT * 4)
  163. + return( -1 );
  164. buf += HEADER_SIZE; Request.type4.context = S2TOS(buf);
  165. buf += SIZEOFSHORT; Request.type4.begin = S2TOS(buf);
  166. -@@ -2340,5 +2360,9 @@ BYTE *buf ;
  167. +@@ -2340,5 +2365,9 @@ BYTE *buf ;
  168. buf += SIZEOFSHORT; Request.type4.yomilen = S2TOS(buf);
  169. Request.type4.yomi = (Ushort *)(buf += SIZEOFSHORT) ;
  170. - len = Request.type4.datalen - SIZEOFSHORT * 4;
  171. @@ -95,42 +123,42 @@
  172. + return( -1 );
  173. for (data = Request.type4.yomi, i = 0; i < len; i++, data++)
  174. *data = ntohs((unsigned short)*data); /* ちょっとやだなあ */
  175. -@@ -2360,4 +2384,6 @@ BYTE *buf ;
  176. +@@ -2360,4 +2389,6 @@ BYTE *buf ;
  177. ir_debug( Dmsg(10, "ProcWideReq5 start!!\n") );
  178.  
  179. + if (Request.type5.datalen != SIZEOFSHORT * 2 + SIZEOFINT)
  180. + return( -1 );
  181. buf += HEADER_SIZE; Request.type5.context = S2TOS(buf);
  182. buf += SIZEOFSHORT; Request.type5.size = S2TOS(buf);
  183. -@@ -2376,4 +2402,6 @@ BYTE *buf ;
  184. +@@ -2376,4 +2407,6 @@ BYTE *buf ;
  185. ir_debug( Dmsg(10, "ProcWideReq6 start!!\n") );
  186.  
  187. + if (Request.type6.datalen != SIZEOFSHORT * 3)
  188. + return( -1 );
  189. buf += HEADER_SIZE; Request.type6.context = S2TOS(buf);
  190. buf += SIZEOFSHORT; Request.type6.number = S2TOS(buf);
  191. -@@ -2392,4 +2420,6 @@ BYTE *buf ;
  192. +@@ -2392,4 +2425,6 @@ BYTE *buf ;
  193. ir_debug( Dmsg(10, "ProcWideReq7 start!!\n") );
  194.  
  195. + if (Request.type7.datalen != SIZEOFSHORT * 3)
  196. + return( -1 );
  197. buf += HEADER_SIZE; Request.type7.context = S2TOS(buf);
  198. buf += SIZEOFSHORT; Request.type7.number = S2TOS(buf);
  199. -@@ -2408,4 +2438,6 @@ BYTE *buf ;
  200. +@@ -2408,4 +2443,6 @@ BYTE *buf ;
  201. ir_debug( Dmsg(10, "ProcWideReq8 start!!\n") );
  202.  
  203. + if (Request.type8.datalen != SIZEOFSHORT * 4)
  204. + return( -1 );
  205. buf += HEADER_SIZE; Request.type8.context = S2TOS(buf);
  206. buf += SIZEOFSHORT; Request.type8.curbun = S2TOS(buf);
  207. -@@ -2426,4 +2458,6 @@ BYTE *buf ;
  208. +@@ -2426,4 +2463,6 @@ BYTE *buf ;
  209. ir_debug( Dmsg(10, "ProcWideReq9 start!!\n") );
  210.  
  211. + if (Request.type9.datalen != SIZEOFSHORT * 4)
  212. + return( -1 );
  213. buf += HEADER_SIZE; Request.type9.context = S2TOS(buf);
  214. buf += SIZEOFSHORT; Request.type9.number = S2TOS(buf);
  215. -@@ -2443,7 +2477,11 @@ BYTE *buf ;
  216. +@@ -2443,7 +2482,11 @@ BYTE *buf ;
  217. {
  218. register int i ;
  219. + int rest;
  220. @@ -142,14 +170,14 @@
  221. + return( -1 );
  222. buf += HEADER_SIZE; Request.type10.context = S2TOS(buf);
  223. buf += SIZEOFSHORT; Request.type10.number = S2TOS(buf);
  224. -@@ -2453,4 +2491,6 @@ BYTE *buf ;
  225. +@@ -2453,4 +2496,6 @@ BYTE *buf ;
  226. ir_debug( Dmsg(10, "req->mode =%d\n", Request.type10.mode) );
  227.  
  228. + if (rest != Request.type10.number * SIZEOFSHORT)
  229. + return( -1 );
  230. buf += SIZEOFINT; Request.type10.kouho = (short *)buf; /* short? */
  231. for (i = 0; i < Request.type10.number; i++) {
  232. -@@ -2469,10 +2509,16 @@ BYTE *buf ;
  233. +@@ -2469,10 +2514,16 @@ BYTE *buf ;
  234. int i, len ;
  235.  
  236. - ir_debug( Dmsg(10, "ProcWideReq10 start!!\n") );
  237. @@ -167,7 +195,7 @@
  238. + return( -1 );
  239. for (data = Request.type11.yomi, i = 0; i < len; i++, data++)
  240. *data = ntohs( *data ); /* なんかやだ */
  241. -@@ -2491,14 +2537,24 @@ BYTE *buf ;
  242. +@@ -2491,14 +2542,24 @@ BYTE *buf ;
  243. {
  244. register Ushort *data;
  245. - int i, len ;
  246. @@ -193,7 +221,7 @@
  247. + return( -1 );
  248. Request.type12.dicname = (char *)buf;
  249. ir_debug( Dmsg(10, "req->context =%d\n", Request.type12.context) );
  250. -@@ -2518,22 +2574,35 @@ BYTE *buf ;
  251. +@@ -2518,22 +2579,35 @@ BYTE *buf ;
  252. {
  253. register Ushort *data;
  254. - int i ,len ;
  255. @@ -231,7 +259,7 @@
  256. + return( -1 );
  257. ir_debug( Dmsg(10, "req->context =%d\n", Request.type13.context) );
  258. ir_debug( Dmsg(10, "req->dicname =%s\n", Request.type13.dicname) );
  259. -@@ -2557,4 +2626,7 @@ BYTE *buf ;
  260. +@@ -2557,4 +2631,7 @@ BYTE *buf ;
  261. ir_debug( Dmsg(10, "ProcWideReq14 start!!\n") );
  262.  
  263. + if (Request.type14.datalen <= SIZEOFINT + SIZEOFSHORT
  264. @@ -239,14 +267,14 @@
  265. + return( -1 );
  266. buf += HEADER_SIZE; Request.type14.mode = L4TOL(buf);
  267. buf += SIZEOFINT; Request.type14.context = S2TOS(buf);
  268. -@@ -2562,4 +2634,6 @@ BYTE *buf ;
  269. +@@ -2562,4 +2639,6 @@ BYTE *buf ;
  270. len = ((int)Request.type14.datalen - SIZEOFSHORT - SIZEOFINT)
  271. / SIZEOFSHORT;
  272. + if (Request.type14.yomi[len - 1] != 0)
  273. + return( -1 );
  274. for (data = Request.type14.yomi, i = 0; i < len; i++, data++)
  275. *data = ntohs( *data ); /* なんかやだ */
  276. -@@ -2578,9 +2652,15 @@ ProcWideReq15(buf)
  277. +@@ -2578,9 +2657,15 @@ ProcWideReq15(buf)
  278. BYTE *buf ;
  279. {
  280. + int rest;
  281. @@ -262,7 +290,7 @@
  282. + return( -1 );
  283. ir_debug( Dmsg(10, "req->mode =%d\n", Request.type15.mode) );
  284. ir_debug( Dmsg(10, "req->context =%d\n", Request.type15.context) );
  285. -@@ -2598,4 +2678,7 @@ BYTE *buf ;
  286. +@@ -2598,4 +2683,7 @@ BYTE *buf ;
  287.  
  288. buf += HEADER_SIZE;
  289. + if (Request.type17.datalen < SIZEOFCHAR * 2
  290. @@ -270,14 +298,14 @@
  291. + return( -1 );
  292. Request.type17.dicname = (char *)buf;
  293. Request.type17.mode = (char)*(buf + Request.type17.datalen - SIZEOFCHAR) ;
  294. -@@ -2614,4 +2697,6 @@ BYTE *buf ;
  295. +@@ -2614,4 +2702,6 @@ BYTE *buf ;
  296. ir_debug( Dmsg(10, "ProcWideReq18 start!!\n") );
  297.  
  298. + if (Request.type18.datalen < SIZEOFSHORT * 2)
  299. + return( -1 );
  300. buf += HEADER_SIZE; Request.type18.context = S2TOS(buf);
  301. buf += SIZEOFSHORT; Request.type18.data = (char *)buf;
  302. -@@ -2631,10 +2716,16 @@ ProcWideReq19(buf)
  303. +@@ -2631,10 +2721,16 @@ ProcWideReq19(buf)
  304. BYTE *buf ;
  305. {
  306. + int rest;
  307. @@ -294,7 +322,7 @@
  308. + return( -1 );
  309. ir_debug( Dmsg(10, "req->context =%d\n", Request.type20.context) );
  310. ir_debug( Dmsg(10, "req->command =%d\n", Request.type20.command) );
  311. -@@ -2648,13 +2739,23 @@ ProcWideReq20(buf)
  312. +@@ -2648,13 +2744,23 @@ ProcWideReq20(buf)
  313. BYTE *buf ;
  314. {
  315. + BYTE *bufend;
  316.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement