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.

90 lines
2.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../netkit-rsh/glibc.patch
  5. # Copyright (C) 2009 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff -Naur ./rexecd/rexecd.c ../copy/rexecd/rexecd.c
  17. --- ./rexecd/rexecd.c 2000-07-23 06:16:22.000000000 +0200
  18. +++ ../copy/rexecd/rexecd.c 2008-06-13 21:33:11.000000000 +0200
  19. @@ -223,7 +223,8 @@
  20. static void
  21. doit(struct sockaddr_in *fromp)
  22. {
  23. - char cmdbuf[ARG_MAX+1];
  24. + char *cmdbuf;
  25. + long cmdbuflen;
  26. char user[16], pass[16];
  27. struct passwd *pwd;
  28. int s = -1;
  29. @@ -242,6 +243,18 @@
  30. #endif
  31. #endif /* USE_PAM */
  32. + cmdbuflen = sysconf (_SC_ARG_MAX);
  33. + if (!(cmdbuflen > 0)) {
  34. + syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed");
  35. + fatal ("sysconf (_SC_ARG_MAX) failed\n");
  36. + }
  37. +
  38. + cmdbuf = malloc (++cmdbuflen);
  39. + if (cmdbuf == NULL) {
  40. + syslog (LOG_ERR, "Could not allocate space for cmdbuf");
  41. + fatal ("Could not allocate space for cmdbuf\n");
  42. + }
  43. +
  44. signal(SIGINT, SIG_DFL);
  45. signal(SIGQUIT, SIG_DFL);
  46. signal(SIGTERM, SIG_DFL);
  47. @@ -291,7 +304,7 @@
  48. getstr(user, sizeof(user), "username too long\n");
  49. getstr(pass, sizeof(pass), "password too long\n");
  50. - getstr(cmdbuf, sizeof(cmdbuf), "command too long\n");
  51. + getstr(cmdbuf, cmdbuflen, "command too long\n");
  52. #ifdef USE_PAM
  53. #define PAM_BAIL if (pam_error != PAM_SUCCESS) { \
  54. pam_end(pamh, pam_error); exit(1); \
  55. diff -Naur ./rshd/rshd.c ../copy/rshd/rshd.c
  56. --- ./rshd/rshd.c 2008-06-13 21:40:15.000000000 +0200
  57. +++ ../copy/rshd/rshd.c 2008-06-13 21:45:04.000000000 +0200
  58. @@ -337,7 +337,8 @@
  59. static void
  60. doit(struct sockaddr_in *fromp)
  61. {
  62. - char cmdbuf[ARG_MAX+1];
  63. + char *cmdbuf;
  64. + long cmdbuflen;
  65. const char *theshell, *shellname;
  66. char locuser[16], remuser[16];
  67. struct passwd *pwd;
  68. @@ -346,6 +347,18 @@
  69. u_short port;
  70. int pv[2], pid, ifd;
  71. + cmdbuflen = sysconf (_SC_ARG_MAX);
  72. + if (!(cmdbuflen > 0)) {
  73. + syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed");
  74. + exit (1);
  75. + }
  76. +
  77. + cmdbuf = malloc (++cmdbuflen);
  78. + if (cmdbuf == NULL) {
  79. + syslog (LOG_ERR, "Could not allocate space for cmdbuf");
  80. + exit (1);
  81. + }
  82. +
  83. signal(SIGINT, SIG_DFL);
  84. signal(SIGQUIT, SIG_DFL);
  85. signal(SIGTERM, SIG_DFL);