OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

715 lines
13 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../wu-ftpd/ftpcmd_y_fix.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. # Copyright (C) 1998 - 2003 Clifford Wolf
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This patch file is dual-licensed. It is available under the license the
  11. # patched project is licensed under, as long as it is an OpenSource license
  12. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  13. # of the GNU General Public License as published by the Free Software
  14. # Foundation; either version 2 of the License, or (at your option) any later
  15. # version.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. --- ./src/ftpcmd.y.orig 2003-01-26 17:59:52.000000000 +0100
  18. +++ ./src/ftpcmd.y 2003-01-26 18:03:50.000000000 +0100
  19. @@ -194,7 +194,7 @@
  20. cmd_list: /* empty */
  21. | cmd_list cmd
  22. - = {
  23. + {
  24. fromname = (char *) NULL;
  25. restart_point = 0;
  26. }
  27. @@ -202,14 +202,14 @@
  28. ;
  29. cmd: USER SP username CRLF
  30. - = {
  31. + {
  32. user($3);
  33. if (log_commands)
  34. syslog(LOG_INFO, "USER %s", $3);
  35. free($3);
  36. }
  37. | PASS SP password CRLF
  38. - = {
  39. + {
  40. if (log_commands)
  41. if (anonymous)
  42. syslog(LOG_INFO, "PASS %s", $3);
  43. @@ -220,7 +220,7 @@
  44. free($3);
  45. }
  46. | PORT check_login SP host_port CRLF
  47. - = {
  48. + {
  49. if (log_commands)
  50. syslog(LOG_INFO, "PORT");
  51. /* H* port fix, part B: admonish the twit.
  52. @@ -252,7 +252,7 @@
  53. }
  54. }
  55. | PASV check_login CRLF
  56. - = {
  57. + {
  58. /* Require login for PASV, too. This actually fixes a bug -- telnet to an
  59. unfixed wu-ftpd and type PASV first off, and it crashes! */
  60. if (log_commands)
  61. @@ -265,7 +265,7 @@
  62. #endif
  63. }
  64. | TYPE check_login SP type_code CRLF
  65. - = {
  66. + {
  67. if (log_commands)
  68. syslog(LOG_INFO, "TYPE %s", typenames[cmd_type]);
  69. if ($2)
  70. @@ -305,7 +305,7 @@
  71. }
  72. }
  73. | STRU check_login SP struct_code CRLF
  74. - = {
  75. + {
  76. if (log_commands)
  77. syslog(LOG_INFO, "STRU %s", strunames[$4]);
  78. if ($2)
  79. @@ -320,7 +320,7 @@
  80. }
  81. }
  82. | MODE check_login SP mode_code CRLF
  83. - = {
  84. + {
  85. if (log_commands)
  86. syslog(LOG_INFO, "MODE %s", modenames[$4]);
  87. if ($2)
  88. @@ -335,21 +335,21 @@
  89. }
  90. }
  91. | ALLO check_login SP NUMBER CRLF
  92. - = {
  93. + {
  94. if (log_commands)
  95. syslog(LOG_INFO, "ALLO %d", $4);
  96. if ($2)
  97. reply(202, "ALLO command ignored.");
  98. }
  99. | ALLO check_login SP NUMBER SP R SP NUMBER CRLF
  100. - = {
  101. + {
  102. if (log_commands)
  103. syslog(LOG_INFO, "ALLO %d R %d", $4, $8);
  104. if ($2)
  105. reply(202, "ALLO command ignored.");
  106. }
  107. | RETR check_login SP pathname CRLF
  108. - = {
  109. + {
  110. if (log_commands)
  111. syslog(LOG_INFO, "RETR %s", CHECKNULL($4));
  112. if ($2 && $4 != NULL && !restrict_check($4)) {
  113. @@ -360,7 +360,7 @@
  114. free($4);
  115. }
  116. | STOR check_login SP pathname CRLF
  117. - = {
  118. + {
  119. if (log_commands)
  120. syslog(LOG_INFO, "STOR %s", CHECKNULL($4));
  121. if ($2 && $4 != NULL && !restrict_check($4))
  122. @@ -369,7 +369,7 @@
  123. free($4);
  124. }
  125. | APPE check_login SP pathname CRLF
  126. - = {
  127. + {
  128. if (log_commands)
  129. syslog(LOG_INFO, "APPE %s", CHECKNULL($4));
  130. if ($2 && $4 != NULL && !restrict_check($4))
  131. @@ -378,14 +378,14 @@
  132. free($4);
  133. }
  134. | NLST check_login CRLF
  135. - = {
  136. + {
  137. if (log_commands)
  138. syslog(LOG_INFO, "NLST");
  139. if ($2 && !restrict_check("."))
  140. send_file_list("");
  141. }
  142. | NLST check_login SP STRING CRLF
  143. - = {
  144. + {
  145. if (log_commands)
  146. syslog(LOG_INFO, "NLST %s", $4);
  147. if ($2 && $4 && !restrict_check($4))
  148. @@ -394,7 +394,7 @@
  149. free($4);
  150. }
  151. | LIST check_login CRLF
  152. - = {
  153. + {
  154. if (log_commands)
  155. syslog(LOG_INFO, "LIST");
  156. if ($2 && !restrict_check(".")) {
  157. @@ -410,7 +410,7 @@
  158. }
  159. }
  160. | LIST check_login SP pathname CRLF
  161. - = {
  162. + {
  163. if (log_commands)
  164. syslog(LOG_INFO, "LIST %s", CHECKNULL($4));
  165. if ($2 && $4 != NULL && !restrict_list_check($4)) {
  166. @@ -428,7 +428,7 @@
  167. free($4);
  168. }
  169. | STAT check_login SP pathname CRLF
  170. - = {
  171. + {
  172. if (log_commands)
  173. syslog(LOG_INFO, "STAT %s", CHECKNULL($4));
  174. if ($2 && $4 != NULL && !restrict_check($4))
  175. @@ -437,14 +437,14 @@
  176. free($4);
  177. }
  178. | STAT check_login CRLF
  179. - = {
  180. + {
  181. if (log_commands)
  182. syslog(LOG_INFO, "STAT");
  183. if ($2)
  184. statcmd();
  185. }
  186. | DELE check_login SP pathname CRLF
  187. - = {
  188. + {
  189. if (log_commands)
  190. syslog(LOG_INFO, "DELE %s", CHECKNULL($4));
  191. if ($2 && $4 != NULL && !restrict_check($4))
  192. @@ -453,7 +453,7 @@
  193. free($4);
  194. }
  195. | RNTO check_login SP pathname CRLF
  196. - = {
  197. + {
  198. if (log_commands)
  199. syslog(LOG_INFO, "RNTO %s", CHECKNULL($4));
  200. if ($2 && $4 && !restrict_check($4)) {
  201. @@ -470,21 +470,21 @@
  202. free($4);
  203. }
  204. | ABOR check_login CRLF
  205. - = {
  206. + {
  207. if (log_commands)
  208. syslog(LOG_INFO, "ABOR");
  209. if ($2)
  210. reply(225, "ABOR command successful.");
  211. }
  212. | CWD check_login CRLF
  213. - = {
  214. + {
  215. if (log_commands)
  216. syslog(LOG_INFO, "CWD");
  217. if ($2 && !restrict_check(home))
  218. cwd(home);
  219. }
  220. | CWD check_login SP pathname CRLF
  221. - = {
  222. + {
  223. if (log_commands)
  224. syslog(LOG_INFO, "CWD %s", CHECKNULL($4));
  225. if ($2 && $4 != NULL && !restrict_check($4))
  226. @@ -493,14 +493,14 @@
  227. free($4);
  228. }
  229. | HELP check_login CRLF
  230. - = {
  231. + {
  232. if (log_commands)
  233. syslog(LOG_INFO, "HELP");
  234. if ($2)
  235. help(cmdtab, (char *) NULL);
  236. }
  237. | HELP check_login SP STRING CRLF
  238. - = {
  239. + {
  240. register char *cp = (char *) $4;
  241. if (log_commands)
  242. @@ -521,14 +521,14 @@
  243. free($4);
  244. }
  245. | NOOP check_login CRLF
  246. - = {
  247. + {
  248. if (log_commands)
  249. syslog(LOG_INFO, "NOOP");
  250. if ($2)
  251. reply(200, "NOOP command successful.");
  252. }
  253. | MKD check_login SP pathname CRLF
  254. - = {
  255. + {
  256. if (log_commands)
  257. syslog(LOG_INFO, "MKD %s", CHECKNULL($4));
  258. if ($2 && $4 != NULL && !restrict_check($4))
  259. @@ -537,7 +537,7 @@
  260. free($4);
  261. }
  262. | RMD check_login SP pathname CRLF
  263. - = {
  264. + {
  265. if (log_commands)
  266. syslog(LOG_INFO, "RMD %s", CHECKNULL($4));
  267. if ($2 && $4 != NULL && !restrict_check($4))
  268. @@ -546,14 +546,14 @@
  269. free($4);
  270. }
  271. | PWD check_login CRLF
  272. - = {
  273. + {
  274. if (log_commands)
  275. syslog(LOG_INFO, "PWD");
  276. if ($2)
  277. pwd();
  278. }
  279. | CDUP check_login CRLF
  280. - = {
  281. + {
  282. if (log_commands)
  283. syslog(LOG_INFO, "CDUP");
  284. if ($2)
  285. @@ -564,14 +564,14 @@
  286. }
  287. | SITE check_login SP HELP CRLF
  288. - = {
  289. + {
  290. if (log_commands)
  291. syslog(LOG_INFO, "SITE HELP");
  292. if ($2)
  293. help(sitetab, (char *) NULL);
  294. }
  295. | SITE check_login SP HELP SP STRING CRLF
  296. - = {
  297. + {
  298. if (log_commands)
  299. syslog(LOG_INFO, "SITE HELP %s", $6);
  300. if ($2)
  301. @@ -580,7 +580,7 @@
  302. free($6);
  303. }
  304. | SITE check_login SP UMASK CRLF
  305. - = {
  306. + {
  307. mode_t oldmask;
  308. if (log_commands)
  309. @@ -592,7 +592,7 @@
  310. }
  311. }
  312. | SITE check_login SP UMASK SP octal_number CRLF
  313. - = {
  314. + {
  315. mode_t oldmask;
  316. struct aclmember *entry = NULL;
  317. int ok = 1;
  318. @@ -620,7 +620,7 @@
  319. }
  320. }
  321. | SITE check_login SP CHMOD SP octal_number SP pathname CRLF
  322. - = {
  323. + {
  324. struct aclmember *entry = NULL;
  325. int ok = (anonymous ? 0 : 1);
  326. @@ -670,7 +670,7 @@
  327. free($8);
  328. }
  329. | SITE check_login SP IDLE CRLF
  330. - = {
  331. + {
  332. if (log_commands)
  333. syslog(LOG_INFO, "SITE IDLE");
  334. if ($2)
  335. @@ -679,7 +679,7 @@
  336. timeout_idle, timeout_maxidle);
  337. }
  338. | SITE check_login SP IDLE SP NUMBER CRLF
  339. - = {
  340. + {
  341. if (log_commands)
  342. syslog(LOG_INFO, "SITE IDLE %d", $6);
  343. if ($2)
  344. @@ -694,7 +694,7 @@
  345. }
  346. }
  347. | SITE check_login SP GROUP SP username CRLF
  348. - = {
  349. + {
  350. #ifndef NO_PRIVATE
  351. if (log_commands)
  352. syslog(LOG_INFO, "SITE GROUP %s", $6);
  353. @@ -704,7 +704,7 @@
  354. #endif /* !NO_PRIVATE */
  355. }
  356. | SITE check_login SP GPASS SP password CRLF
  357. - = {
  358. + {
  359. #ifndef NO_PRIVATE
  360. if (log_commands)
  361. syslog(LOG_INFO, "SITE GPASS password");
  362. @@ -714,7 +714,7 @@
  363. #endif /* !NO_PRIVATE */
  364. }
  365. | SITE check_login SP GPASS CRLF
  366. - = {
  367. + {
  368. #ifndef NO_PRIVATE
  369. if (log_commands)
  370. syslog(LOG_INFO, "SITE GPASS");
  371. @@ -723,7 +723,7 @@
  372. #endif /* !NO_PRIVATE */
  373. }
  374. | SITE check_login SP NEWER SP STRING CRLF
  375. - = {
  376. + {
  377. if (log_commands)
  378. syslog(LOG_INFO, "SITE NEWER %s", $6);
  379. #ifdef SITE_NEWER
  380. @@ -735,7 +735,7 @@
  381. free($6);
  382. }
  383. | SITE check_login SP NEWER SP STRING SP pathname CRLF
  384. - = {
  385. + {
  386. if (log_commands)
  387. syslog(LOG_INFO, "SITE NEWER %s %s", $6,
  388. CHECKNULL($8));
  389. @@ -750,7 +750,7 @@
  390. free($8);
  391. }
  392. | SITE check_login SP MINFO SP STRING CRLF
  393. - = {
  394. + {
  395. if (log_commands)
  396. syslog(LOG_INFO, "SITE MINFO %s", $6);
  397. #ifdef SITE_NEWER
  398. @@ -762,7 +762,7 @@
  399. free($6);
  400. }
  401. | SITE check_login SP MINFO SP STRING SP pathname CRLF
  402. - = {
  403. + {
  404. if (log_commands)
  405. syslog(LOG_INFO, "SITE MINFO %s %s", $6,
  406. CHECKNULL($8));
  407. @@ -777,7 +777,7 @@
  408. free($8);
  409. }
  410. | SITE check_login SP INDEX SP STRING CRLF
  411. - = {
  412. + {
  413. /* this is just for backward compatibility since we
  414. * thought of INDEX before we thought of EXEC
  415. */
  416. @@ -792,7 +792,7 @@
  417. free($6);
  418. }
  419. | SITE check_login SP EXEC SP STRING CRLF
  420. - = {
  421. + {
  422. if (!restricted_user && $2 != 0 && $6 != NULL) {
  423. (void) site_exec((char *) $6);
  424. }
  425. @@ -801,7 +801,7 @@
  426. }
  427. | STOU check_login SP pathname CRLF
  428. - = {
  429. + {
  430. if (log_commands)
  431. syslog(LOG_INFO, "STOU %s", CHECKNULL($4));
  432. if ($2 && $4 && !restrict_check($4))
  433. @@ -810,7 +810,7 @@
  434. free($4);
  435. }
  436. | SYST check_login CRLF
  437. - = {
  438. + {
  439. if (log_commands)
  440. syslog(LOG_INFO, "SYST");
  441. if ($2)
  442. @@ -834,7 +834,7 @@
  443. * using with RESTART (we just count bytes).
  444. */
  445. | SIZE check_login SP pathname CRLF
  446. - = {
  447. + {
  448. if (log_commands)
  449. syslog(LOG_INFO, "SIZE %s", CHECKNULL($4));
  450. if ($2 && $4 && !restrict_check($4)) {
  451. @@ -854,7 +854,7 @@
  452. * not necessarily 3 digits)
  453. */
  454. | MDTM check_login SP pathname CRLF
  455. - = {
  456. + {
  457. if (log_commands)
  458. syslog(LOG_INFO, "MDTM %s", CHECKNULL($4));
  459. if ($2 && $4 && !restrict_check($4)) {
  460. @@ -879,7 +879,7 @@
  461. free($4);
  462. }
  463. | QUIT CRLF
  464. - = {
  465. + {
  466. if (log_commands)
  467. syslog(LOG_INFO, "QUIT");
  468. #ifdef TRANSFER_COUNT
  469. @@ -893,13 +893,13 @@
  470. dologout(0);
  471. }
  472. | error CRLF
  473. - = {
  474. + {
  475. yyerrok;
  476. }
  477. ;
  478. rcmd: RNFR check_login SP pathname CRLF
  479. - = {
  480. + {
  481. if (log_commands)
  482. syslog(LOG_INFO, "RNFR %s", CHECKNULL($4));
  483. @@ -912,7 +912,7 @@
  484. free($4);
  485. }
  486. | REST check_login SP byte_size CRLF
  487. - = {
  488. + {
  489. if (log_commands)
  490. syslog(LOG_INFO, "REST %d", (int) restart_point);
  491. if ($2) {
  492. @@ -924,14 +924,14 @@
  493. }
  494. | SITE check_login SP ALIAS CRLF
  495. - = {
  496. + {
  497. if (log_commands)
  498. syslog(LOG_INFO, "SITE ALIAS");
  499. if ($2)
  500. alias((char *) NULL);
  501. }
  502. | SITE check_login SP ALIAS SP STRING CRLF
  503. - = {
  504. + {
  505. if (log_commands)
  506. syslog(LOG_INFO, "SITE ALIAS %s", $6);
  507. if ($2)
  508. @@ -940,21 +940,21 @@
  509. free($6);
  510. }
  511. | SITE check_login SP GROUPS CRLF
  512. - = {
  513. + {
  514. if (log_commands)
  515. syslog(LOG_INFO, "SITE GROUPS");
  516. if ($2)
  517. print_groups();
  518. }
  519. | SITE check_login SP CDPATH CRLF
  520. - = {
  521. + {
  522. if (log_commands)
  523. syslog(LOG_INFO, "SITE CDPATH");
  524. if ($2)
  525. cdpath();
  526. }
  527. | SITE check_login SP CHECKMETHOD SP method CRLF
  528. - = {
  529. + {
  530. if (log_commands)
  531. syslog(LOG_INFO, "SITE CHECKMETHOD %s", CHECKNULL($6));
  532. if (($2) && ($6 != NULL))
  533. @@ -963,14 +963,14 @@
  534. free($6);
  535. }
  536. | SITE check_login SP CHECKMETHOD CRLF
  537. - = {
  538. + {
  539. if (log_commands)
  540. syslog(LOG_INFO, "SITE CHECKMETHOD");
  541. if ($2)
  542. ShowCheckMethod();
  543. }
  544. | SITE check_login SP CHECKSUM SP pathname CRLF
  545. - = {
  546. + {
  547. if (log_commands)
  548. syslog(LOG_INFO, "SITE CHECKSUM %s", CHECKNULL($6));
  549. if (($2) && ($6 != NULL) && (!restrict_check($6)))
  550. @@ -979,7 +979,7 @@
  551. free($6);
  552. }
  553. | SITE check_login SP CHECKSUM CRLF
  554. - = {
  555. + {
  556. if (log_commands)
  557. syslog(LOG_INFO, "SITE CHECKSUM");
  558. if ($2)
  559. @@ -991,7 +991,7 @@
  560. ;
  561. password: /* empty */
  562. - = {
  563. + {
  564. $$ = (char *) malloc(1);
  565. $$[0] = '\0';
  566. }
  567. @@ -1002,7 +1002,7 @@
  568. ;
  569. host_port: NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER
  570. - = {
  571. + {
  572. register char *a, *p;
  573. a = (char *) &cliaddr;
  574. @@ -1017,91 +1017,91 @@
  575. ;
  576. form_code: N
  577. - = {
  578. + {
  579. $$ = FORM_N;
  580. }
  581. | T
  582. - = {
  583. + {
  584. $$ = FORM_T;
  585. }
  586. | C
  587. - = {
  588. + {
  589. $$ = FORM_C;
  590. }
  591. ;
  592. type_code: A
  593. - = {
  594. + {
  595. cmd_type = TYPE_A;
  596. cmd_form = FORM_N;
  597. }
  598. | A SP form_code
  599. - = {
  600. + {
  601. cmd_type = TYPE_A;
  602. cmd_form = $3;
  603. }
  604. | E
  605. - = {
  606. + {
  607. cmd_type = TYPE_E;
  608. cmd_form = FORM_N;
  609. }
  610. | E SP form_code
  611. - = {
  612. + {
  613. cmd_type = TYPE_E;
  614. cmd_form = $3;
  615. }
  616. | I
  617. - = {
  618. + {
  619. cmd_type = TYPE_I;
  620. }
  621. | L
  622. - = {
  623. + {
  624. cmd_type = TYPE_L;
  625. cmd_bytesz = NBBY;
  626. }
  627. | L SP byte_size
  628. - = {
  629. + {
  630. cmd_type = TYPE_L;
  631. cmd_bytesz = $3;
  632. }
  633. /* this is for a bug in the BBN ftp */
  634. | L byte_size
  635. - = {
  636. + {
  637. cmd_type = TYPE_L;
  638. cmd_bytesz = $2;
  639. }
  640. ;
  641. struct_code: F
  642. - = {
  643. + {
  644. $$ = STRU_F;
  645. }
  646. | R
  647. - = {
  648. + {
  649. $$ = STRU_R;
  650. }
  651. | P
  652. - = {
  653. + {
  654. $$ = STRU_P;
  655. }
  656. ;
  657. mode_code: S
  658. - = {
  659. + {
  660. $$ = MODE_S;
  661. }
  662. | B
  663. - = {
  664. + {
  665. $$ = MODE_B;
  666. }
  667. | C
  668. - = {
  669. + {
  670. $$ = MODE_C;
  671. }
  672. ;
  673. pathname: pathstring
  674. - = {
  675. + {
  676. /*
  677. * Problem: this production is used for all pathname
  678. * processing, but only gives a 550 error reply.
  679. @@ -1193,7 +1193,7 @@
  680. ;
  681. octal_number: NUMBER
  682. - = {
  683. + {
  684. register int ret, dec, multby, digit;
  685. /*
  686. @@ -1218,7 +1218,7 @@
  687. ;
  688. check_login: /* empty */
  689. - = {
  690. + {
  691. if (logged_in)
  692. $$ = 1;
  693. else {