openser.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. Index: Makefile.defs
  2. --- Makefile.defs.orig 2007-08-16 16:23:20 +0200
  3. +++ Makefile.defs 2007-11-24 19:39:03 +0100
  4. @@ -983,6 +983,8 @@
  5. endif #mode=release
  6. +LDFLAGS += -L$(prefix)/lib
  7. +LIBS += -lfsl
  8. #*FLAGS used for compiling the modules
  9. ifeq ($(CC_NAME), gcc)
  10. @@ -1205,8 +1207,8 @@
  11. #add libssl if needed
  12. ifneq ($(TLS),)
  13. -DEFS+= -I$(LOCALBASE)/ssl/include
  14. -LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl -lcrypto
  15. +DEFS+= -I$(prefix)/include
  16. +LIBS+= -L$(prefix)/lib -lssl -lcrypto
  17. endif
  18. ifneq ($(found_lock_method), yes)
  19. Index: modules/permissions/parse_config.c
  20. --- modules/permissions/parse_config.c.orig 2007-08-16 16:22:57 +0200
  21. +++ modules/permissions/parse_config.c 2007-11-24 19:39:03 +0100
  22. @@ -114,8 +114,11 @@
  23. except = strstr(str, " EXCEPT ");
  24. if (except) {
  25. /* exception found */
  26. - strncpy(str2, str, except-str);
  27. - str2[except-str] = '\0';
  28. + int l = except - str;
  29. + if (l > sizeof(str2) - 1)
  30. + l = sizeof(str2) - 1;
  31. + strncpy(str2, str, l);
  32. + str2[l] = '\0';
  33. /* except+8 points to the exception */
  34. if (parse_expression_list(except+8, e_exceptions)) {
  35. /* error */
  36. @@ -124,7 +127,8 @@
  37. }
  38. } else {
  39. /* no exception */
  40. - strcpy(str2, str);
  41. + strncpy(str2, str, sizeof(str2)-1);
  42. + str2[sizeof(str2)-1] = '\0';
  43. *e_exceptions = NULL;
  44. }
  45. Index: rtpproxy/main.c
  46. --- rtpproxy/main.c.orig 2007-11-23 11:17:02 +0100
  47. +++ rtpproxy/main.c 2007-11-24 19:39:55 +0100
  48. @@ -40,7 +40,7 @@
  49. #include <sys/select.h>
  50. #include <sys/stat.h>
  51. #include <assert.h>
  52. -#if !defined(__solaris__)
  53. +#if !defined(__sun__)
  54. #include <err.h>
  55. #endif
  56. #include <errno.h>
  57. @@ -113,7 +113,11 @@
  58. bindhost = NULL;
  59. if ((n = resolve(ia, pf, bindhost, servname, AI_PASSIVE)) != 0)
  60. +#if defined(__sun__)
  61. + errx(1, "setbindhost");
  62. +#else
  63. errx(1, "setbindhost: %s", gai_strerror(n));
  64. +#endif
  65. }
  66. static void
  67. @@ -371,10 +375,9 @@
  68. rtpp_log_write(RTPP_LOG_DBUG, cf->glog, "received command \"%s\"", buf);
  69. - cp = buf;
  70. argc = 0;
  71. memset(argv, 0, sizeof(argv));
  72. - for (ap = argv; (*ap = strsep(&cp, "\r\n\t ")) != NULL;)
  73. + for (ap = argv, cp = strtok(buf, "\r\n\t "); (cp = strtok(NULL, "\r\n\t ")) != NULL;)
  74. if (**ap != '\0') {
  75. argc++;
  76. if (++ap >= &argv[10])
  77. @@ -651,7 +654,11 @@
  78. }
  79. } else {
  80. rtpp_log_write(RTPP_LOG_ERR, cf->glog, "getaddrinfo: %s",
  81. +#if defined(__sun__)
  82. + "unknown");
  83. +#else
  84. gai_strerror(n));
  85. +#endif
  86. }
  87. }
  88. }
  89. @@ -1222,7 +1229,7 @@
  90. if (cf->umode == 0) {
  91. unlink(cmd_sock);
  92. memset(&ifsun, '\0', sizeof ifsun);
  93. -#if !defined(__linux__) && !defined(__solaris__)
  94. +#if !defined(__linux__) && !defined(__sun__)
  95. ifsun.sun_len = strlen(cmd_sock);
  96. #endif
  97. ifsun.sun_family = AF_LOCAL;
  98. @@ -1537,7 +1544,7 @@
  99. controlfd = init_controlfd(&cf);
  100. -#if !defined(__solaris__)
  101. +#if !defined(__sun__)
  102. if (cf.nodaemon == 0) {
  103. if (daemon(0, 0) == -1)
  104. err(1, "can't switch into daemon mode");
  105. Index: rtpproxy/rtpp_util.h
  106. --- rtpproxy/rtpp_util.h.orig 2007-07-28 10:17:02 +0200
  107. +++ rtpproxy/rtpp_util.h 2007-11-24 19:39:03 +0100
  108. @@ -84,7 +84,7 @@
  109. #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
  110. #endif
  111. -#if defined(__solaris__)
  112. +#if defined(__sun__)
  113. #define err(exitcode, format, args...) \
  114. errx(exitcode, format ": %s", ## args, strerror(errno))
  115. #define errx(exitcode, format, args...) \