ssmtp.patch 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. Index: Makefile.in
  2. --- Makefile.in.orig 2008-02-29 03:50:15 +0100
  3. +++ Makefile.in 2009-07-07 22:45:14 +0200
  4. @@ -16,7 +16,7 @@
  5. # Configuration files
  6. CONFIGURATION_FILE=$(SSMTPCONFDIR)/ssmtp.conf
  7. -REVALIASES_FILE=$(SSMTPCONFDIR)/revaliases
  8. +REVALIASES_FILE=$(SSMTPCONFDIR)/ssmtp.revaliases
  9. INSTALLED_CONFIGURATION_FILE=$(CONFIGURATION_FILE)
  10. INSTALLED_REVALIASES_FILE=$(REVALIASES_FILE)
  11. Index: newaliases.8
  12. --- /dev/null 2009-07-07 22:45:20 +0200
  13. +++ newaliases.8 2009-07-07 22:45:14 +0200
  14. @@ -0,0 +1,17 @@
  15. +.TH NEWALIASES 8 "September 2000" "Debian GNU/Linux"
  16. +.SH NAME
  17. +newaliases \- update /etc/aliases database
  18. +.SH SYNOPSIS
  19. +.B newaliases
  20. +.SH DESCRIPTION
  21. +This is a link to the ssmtp binary. It invokes
  22. +.B /usr/sbin/sendmail
  23. +with the
  24. +.B -bi
  25. +option. It is provided for compatibility with the sendmail program.
  26. +.P
  27. +In this case it does absolutely nothing since sSMTP does not support
  28. +/etc/aliases and is just there to avoid programs returning error messages.
  29. +.SH AUTHOR
  30. +This manual page was written by Christoph Lameter <clameter@debian.org>,
  31. +for the Debian GNU/Linux system. Minor fixes by Matt Ryan <mryan@debian.org>
  32. Index: ssmtp.c
  33. --- ssmtp.c.orig 2009-07-07 04:56:01 +0200
  34. +++ ssmtp.c 2009-07-07 22:46:12 +0200
  35. @@ -39,6 +39,10 @@
  36. #include <fcntl.h>
  37. #include "xgethostname.h"
  38. +#ifndef NUL
  39. +#define NUL '\0'
  40. +#endif
  41. +
  42. bool_t have_date = False;
  43. bool_t have_from = False;
  44. #ifdef HASTO_OPTION
  45. @@ -55,21 +59,21 @@
  46. #define ARPADATE_LENGTH 32 /* Current date in RFC format */
  47. char arpadate[ARPADATE_LENGTH];
  48. -char *auth_user = (char)NULL;
  49. -char *auth_pass = (char)NULL;
  50. -char *auth_method = (char)NULL; /* Mechanism for SMTP authentication */
  51. -char *mail_domain = (char)NULL;
  52. -char *from = (char)NULL; /* Use this as the From: address */
  53. +char *auth_user = (char *)NULL;
  54. +char *auth_pass = (char *)NULL;
  55. +char *auth_method = (char *)NULL; /* Mechanism for SMTP authentication */
  56. +char *mail_domain = (char *)NULL;
  57. +char *from = (char *)NULL; /* Use this as the From: address */
  58. char *hostname;
  59. char *mailhost = "mailhub";
  60. -char *minus_f = (char)NULL;
  61. -char *minus_F = (char)NULL;
  62. +char *minus_f = (char *)NULL;
  63. +char *minus_F = (char *)NULL;
  64. char *gecos;
  65. -char *prog = (char)NULL;
  66. +char *prog = (char *)NULL;
  67. char *root = NULL;
  68. char *tls_cert = "/etc/ssl/certs/ssmtp.pem"; /* Default Certificate */
  69. -char *uad = (char)NULL;
  70. -char *config_file = (char)NULL; /* alternate configuration file */
  71. +char *uad = (char *)NULL;
  72. +char *config_file = (char *)NULL; /* alternate configuration file */
  73. headers_t headers, *ht;
  74. @@ -222,11 +226,10 @@
  75. exit(1);
  76. }
  77. -#ifndef _GNU_SOURCE
  78. /*
  79. basename() -- Return last element of path
  80. */
  81. -char *basename(char *str)
  82. +char *mybasename(char *str)
  83. {
  84. char *p;
  85. @@ -237,7 +240,6 @@
  86. return(strdup(p));
  87. }
  88. -#endif /* _GNU_SOURCE */
  89. /*
  90. strip_pre_ws() -- Return pointer to first non-whitespace character
  91. @@ -261,7 +263,7 @@
  92. p = (str + strlen(str));
  93. while(isspace(*--p)) {
  94. - *p = (char)NULL;
  95. + *p = NUL;
  96. }
  97. return(p);
  98. @@ -287,7 +289,7 @@
  99. q++;
  100. if((p = strchr(q, '>'))) {
  101. - *p = (char)NULL;
  102. + *p = NUL;
  103. }
  104. #if 0
  105. @@ -310,7 +312,7 @@
  106. q = strip_post_ws(p);
  107. if(*q == ')') {
  108. while((*--q != '('));
  109. - *q = (char)NULL;
  110. + *q = NUL;
  111. }
  112. (void)strip_post_ws(p);
  113. @@ -363,7 +365,7 @@
  114. *linestart = False;
  115. if((p = strchr(str, '\n'))) {
  116. - *p = (char)NULL;
  117. + *p = NUL;
  118. *linestart = True;
  119. }
  120. return(leadingdot);
  121. @@ -384,7 +386,7 @@
  122. while(fgets(buf, sizeof(buf), fp)) {
  123. /* Make comments invisible */
  124. if((p = strchr(buf, '#'))) {
  125. - *p = (char)NULL;
  126. + *p = NUL;
  127. }
  128. /* Ignore malformed lines and comments */
  129. @@ -519,7 +521,7 @@
  130. #endif
  131. /* Ignore missing usernames */
  132. - if(*str == (char)NULL) {
  133. + if(*str == NUL) {
  134. return;
  135. }
  136. @@ -576,7 +578,7 @@
  137. }
  138. /* End of string? */
  139. - if(*(q + 1) == (char)NULL) {
  140. + if(*(q + 1) == NUL) {
  141. got_addr = True;
  142. }
  143. @@ -584,7 +586,7 @@
  144. if((*q == ',') && (in_quotes == False)) {
  145. got_addr = True;
  146. - *q = (char)NULL;
  147. + *q = NUL;
  148. }
  149. if(got_addr) {
  150. @@ -676,7 +678,7 @@
  151. if(strncasecmp(ht->string, "From:", 5) == 0) {
  152. #if 1
  153. /* Hack check for NULL From: line */
  154. - if(*(p + 6) == (char)NULL) {
  155. + if(*(p + 6) == NUL) {
  156. return;
  157. }
  158. #endif
  159. @@ -741,7 +743,7 @@
  160. size_t size = BUF_SZ, len = 0;
  161. char *p = (char *)NULL, *q;
  162. bool_t in_header = True;
  163. - char l = (char)NULL;
  164. + char l = NUL;
  165. int c;
  166. while(in_header && ((c = fgetc(stream)) != EOF)) {
  167. @@ -776,9 +778,9 @@
  168. in_header = False;
  169. default:
  170. - *q = (char)NULL;
  171. + *q = NUL;
  172. if((q = strrchr(p, '\n'))) {
  173. - *q = (char)NULL;
  174. + *q = NUL;
  175. }
  176. header_save(p);
  177. @@ -809,9 +811,9 @@
  178. in_header = False;
  179. default:
  180. - *q = (char)NULL;
  181. + *q = NUL;
  182. if((q = strrchr(p, '\n'))) {
  183. - *q = (char)NULL;
  184. + *q = NUL;
  185. }
  186. header_save(p);
  187. @@ -844,10 +846,12 @@
  188. if (!rest) {
  189. return NULL;
  190. }
  191. - tok=strndup(*s,rest-(*s));
  192. + tok=malloc(rest-(*s));
  193. if (!tok) {
  194. - die("firsttok() -- strndup() failed");
  195. + die("firsttok() -- malloc() failed");
  196. }
  197. + strncpy(tok, *s, rest-(*s));
  198. + tok[rest-(*s)] = '\0';
  199. *s=rest+1;
  200. return tok;
  201. }
  202. @@ -876,7 +880,7 @@
  203. char *rightside;
  204. /* Make comments invisible */
  205. if((p = strchr(buf, '#'))) {
  206. - *p = (char)NULL;
  207. + *p = NUL;
  208. }
  209. /* Ignore malformed lines and comments */
  210. @@ -1310,7 +1314,7 @@
  211. buf[i++] = c;
  212. }
  213. }
  214. - buf[i] = (char)NULL;
  215. + buf[i] = NUL;
  216. return(buf);
  217. }
  218. @@ -1737,7 +1741,7 @@
  219. j = 0;
  220. add = 1;
  221. - while(argv[i][++j] != (char)NULL) {
  222. + while(argv[i][++j] != NUL) {
  223. switch(argv[i][j]) {
  224. #ifdef INET6
  225. case '6':
  226. @@ -2066,7 +2070,7 @@
  227. (void)signal(SIGTTOU, SIG_IGN);
  228. /* Set the globals */
  229. - prog = basename(argv[0]);
  230. + prog = mybasename(argv[0]);
  231. hostname = xgethostname();