...
|
...
|
@@ -26,6 +26,9 @@
|
26
|
26
|
*
|
27
|
27
|
* Change History:
|
28
|
28
|
* $Log: clamav-milter.c,v $
|
|
29
|
+ * Revision 1.122 2004/09/08 16:03:36 nigelhorne
|
|
30
|
+ * i18n
|
|
31
|
+ *
|
29
|
32
|
* Revision 1.121 2004/08/26 10:22:00 nigelhorne
|
30
|
33
|
* Fix overflow To:
|
31
|
34
|
*
|
...
|
...
|
@@ -374,9 +377,9 @@
|
374
|
374
|
* Revision 1.6 2003/09/28 16:37:23 nigelhorne
|
375
|
375
|
* Added -f flag use MaxThreads if --max-children not set
|
376
|
376
|
*/
|
377
|
|
-static char const rcsid[] = "$Id: clamav-milter.c,v 1.121 2004/08/26 10:22:00 nigelhorne Exp $";
|
|
377
|
+static char const rcsid[] = "$Id: clamav-milter.c,v 1.122 2004/09/08 16:03:36 nigelhorne Exp $";
|
378
|
378
|
|
379
|
|
-#define CM_VERSION "0.75m"
|
|
379
|
+#define CM_VERSION "0.75n"
|
380
|
380
|
|
381
|
381
|
/*#define CONFDIR "/usr/local/etc"*/
|
382
|
382
|
|
...
|
...
|
@@ -422,6 +425,20 @@ static char const rcsid[] = "$Id: clamav-milter.c,v 1.121 2004/08/26 10:22:00 ni
|
422
|
422
|
#include <grp.h>
|
423
|
423
|
#include <netdb.h>
|
424
|
424
|
|
|
425
|
+#ifdef C_LINUX
|
|
426
|
+#include <libintl.h>
|
|
427
|
+
|
|
428
|
+#define gettext_noop(s) s
|
|
429
|
+#define _(s) gettext(s)
|
|
430
|
+#define N_(s) gettext_noop(s)
|
|
431
|
+
|
|
432
|
+#else
|
|
433
|
+
|
|
434
|
+#define _(s) s
|
|
435
|
+#define N_(s) s
|
|
436
|
+
|
|
437
|
+#endif
|
|
438
|
+
|
425
|
439
|
#ifdef WITH_TCPWRAP
|
426
|
440
|
#include <tcpd.h>
|
427
|
441
|
|
...
|
...
|
@@ -435,7 +452,7 @@ int deny_severity = LOG_NOTICE;
|
435
|
435
|
#endif
|
436
|
436
|
|
437
|
437
|
#define _GNU_SOURCE
|
438
|
|
-#include "getopt.h"
|
|
438
|
+#include <getopt.h>
|
439
|
439
|
|
440
|
440
|
#ifndef SENDMAIL_BIN
|
441
|
441
|
#define SENDMAIL_BIN "/usr/lib/sendmail"
|
...
|
...
|
@@ -614,7 +631,7 @@ static long streamMaxLength = -1; /* StreamMaxLength from clamav.conf */
|
614
|
614
|
static int logClean = 1; /*
|
615
|
615
|
* Add clean items to the log file
|
616
|
616
|
*/
|
617
|
|
-static char *signature = "-- \nScanned by ClamAv - http://www.clamav.net\n";
|
|
617
|
+static char *signature = N_("-- \nScanned by ClamAv - http://www.clamav.net\n");
|
618
|
618
|
static time_t signatureStamp;
|
619
|
619
|
static char *templatefile; /* e-mail to be sent when virus detected */
|
620
|
620
|
|
...
|
...
|
@@ -671,38 +688,38 @@ help(void)
|
671
|
671
|
printf("\n\tclamav-milter version %s\n", CM_VERSION);
|
672
|
672
|
puts("\tCopyright (C) 2004 Nigel Horne <njh@despammed.com>\n");
|
673
|
673
|
|
674
|
|
- puts("\t--advisory\t\t-A\tFlag viruses rather than deleting them.");
|
675
|
|
- puts("\t--bounce\t\t-b\tSend a failure message to the sender.");
|
676
|
|
- puts("\t--config-file=FILE\t-c FILE\tRead configuration from FILE.");
|
677
|
|
- puts("\t--debug\t\t\t-D\tPrint debug messages.");
|
678
|
|
- puts("\t--dont-log-clean\t-C\tDon't add an entry to syslog that a mail is clean.");
|
679
|
|
- puts("\t--dont-scan-on-error\t-d\tPass e-mails through unscanned if a system error occurs.");
|
680
|
|
- puts("\t--dont-wait\t\t\tAsk remote end to resend if max-children exceeded.");
|
681
|
|
- puts("\t--from=EMAIL\t\t-a EMAIL\tError messages come from here.");
|
682
|
|
- puts("\t--force-scan\t\t-f\tForce scan all messages (overrides (-o and -l).");
|
683
|
|
- puts("\t--help\t\t\t-h\tThis message.");
|
684
|
|
- puts("\t--headers\t\t-H\tInclude original message headers in the report.");
|
685
|
|
- puts("\t--local\t\t\t-l\tScan messages sent from machines on our LAN.");
|
686
|
|
- puts("\t--outgoing\t\t-o\tScan outgoing messages from this machine.");
|
687
|
|
- puts("\t--noreject\t\t-N\tDon't reject viruses, silently throw them away.");
|
688
|
|
- puts("\t--noxheader\t\t-n\tSuppress X-Virus-Scanned/X-Virus-Status headers.");
|
689
|
|
- puts("\t--pidfile=FILE\t\t-i FILE\tLocation of pidfile.");
|
690
|
|
- puts("\t--postmaster\t\t-p EMAIL\tPostmaster address [default=postmaster].");
|
691
|
|
- puts("\t--postmaster-only\t-P\tSend warnings only to the postmaster.");
|
692
|
|
- puts("\t--quiet\t\t\t-q\tDon't send e-mail notifications of interceptions.");
|
693
|
|
- puts("\t--quarantine=USER\t-Q EMAIL\tQuanrantine e-mail account.");
|
694
|
|
- puts("\t--quarantine-dir=DIR\t-U DIR\tDirectory to store infected emails.");
|
695
|
|
- puts("\t--server=SERVER\t\t-s SERVER\tHostname/IP address of server(s) running clamd (when using TCPsocket).");
|
696
|
|
- puts("\t--sign\t\t\t-S\tAdd a hard-coded signature to each scanned message.");
|
697
|
|
- puts("\t--signature-file=FILE\t-F FILE\tLocation of signature file.");
|
698
|
|
- puts("\t--template-file=FILE\t-t FILE\tLocation of e-mail template file.");
|
699
|
|
- puts("\t--timeout=SECS\t\t-T SECS\tTimeout waiting to childen to die.");
|
700
|
|
- puts("\t--version\t\t-V\tPrint the version number of this software.");
|
|
674
|
+ puts(_("\t--advisory\t\t-A\tFlag viruses rather than deleting them."));
|
|
675
|
+ puts(_("\t--bounce\t\t-b\tSend a failure message to the sender."));
|
|
676
|
+ puts(_("\t--config-file=FILE\t-c FILE\tRead configuration from FILE."));
|
|
677
|
+ puts(_("\t--debug\t\t\t-D\tPrint debug messages."));
|
|
678
|
+ puts(_("\t--dont-log-clean\t-C\tDon't add an entry to syslog that a mail is clean."));
|
|
679
|
+ puts(_("\t--dont-scan-on-error\t-d\tPass e-mails through unscanned if a system error occurs."));
|
|
680
|
+ puts(_("\t--dont-wait\t\t\tAsk remote end to resend if max-children exceeded."));
|
|
681
|
+ puts(_("\t--from=EMAIL\t\t-a EMAIL\tError messages come from here."));
|
|
682
|
+ puts(_("\t--force-scan\t\t-f\tForce scan all messages (overrides (-o and -l)."));
|
|
683
|
+ puts(_("\t--help\t\t\t-h\tThis message."));
|
|
684
|
+ puts(_("\t--headers\t\t-H\tInclude original message headers in the report."));
|
|
685
|
+ puts(_("\t--local\t\t\t-l\tScan messages sent from machines on our LAN."));
|
|
686
|
+ puts(_("\t--outgoing\t\t-o\tScan outgoing messages from this machine."));
|
|
687
|
+ puts(_("\t--noreject\t\t-N\tDon't reject viruses, silently throw them away."));
|
|
688
|
+ puts(_("\t--noxheader\t\t-n\tSuppress X-Virus-Scanned/X-Virus-Status headers."));
|
|
689
|
+ puts(_("\t--pidfile=FILE\t\t-i FILE\tLocation of pidfile."));
|
|
690
|
+ puts(_("\t--postmaster\t\t-p EMAIL\tPostmaster address [default=postmaster]."));
|
|
691
|
+ puts(_("\t--postmaster-only\t-P\tSend warnings only to the postmaster."));
|
|
692
|
+ puts(_("\t--quiet\t\t\t-q\tDon't send e-mail notifications of interceptions."));
|
|
693
|
+ puts(_("\t--quarantine=USER\t-Q EMAIL\tQuanrantine e-mail account."));
|
|
694
|
+ puts(_("\t--quarantine-dir=DIR\t-U DIR\tDirectory to store infected emails."));
|
|
695
|
+ puts(_("\t--server=SERVER\t\t-s SERVER\tHostname/IP address of server(s) running clamd (when using TCPsocket)."));
|
|
696
|
+ puts(_("\t--sign\t\t\t-S\tAdd a hard-coded signature to each scanned message."));
|
|
697
|
+ puts(_("\t--signature-file=FILE\t-F FILE\tLocation of signature file."));
|
|
698
|
+ puts(_("\t--template-file=FILE\t-t FILE\tLocation of e-mail template file."));
|
|
699
|
+ puts(_("\t--timeout=SECS\t\t-T SECS\tTimeout waiting to childen to die."));
|
|
700
|
+ puts(_("\t--version\t\t-V\tPrint the version number of this software."));
|
701
|
701
|
#ifdef CL_DEBUG
|
702
|
|
- puts("\t--debug-level=n\t\t-x n\tSets the debug level to 'n'.");
|
|
702
|
+ puts(_("\t--debug-level=n\t\t-x n\tSets the debug level to 'n'."));
|
703
|
703
|
#endif
|
704
|
|
- puts("\nFor more information type \"man clamav-milter\".");
|
705
|
|
- puts("Report bugs to bugs@clamav.net.");
|
|
704
|
+ puts(_("\nFor more information type \"man clamav-milter\"."));
|
|
705
|
+ puts(_("Report bugs to bugs@clamav.net."));
|
706
|
706
|
}
|
707
|
707
|
|
708
|
708
|
int
|
...
|
...
|
@@ -744,6 +761,12 @@ main(int argc, char **argv)
|
744
|
744
|
"ClamAV version %s, clamav-milter version %s",
|
745
|
745
|
VERSION, CM_VERSION);
|
746
|
746
|
|
|
747
|
+#ifdef C_LINUX
|
|
748
|
+ setlocale(LC_ALL, "");
|
|
749
|
+ bindtextdomain("clamav-milter", "locale");
|
|
750
|
+ textdomain("clamav-milter");
|
|
751
|
+#endif
|
|
752
|
+
|
747
|
753
|
for(;;) {
|
748
|
754
|
int opt_index = 0;
|
749
|
755
|
#ifdef CL_DEBUG
|
...
|
...
|
@@ -960,7 +983,7 @@ main(int argc, char **argv)
|
960
|
960
|
}
|
961
|
961
|
|
962
|
962
|
if (optind == argc) {
|
963
|
|
- fprintf(stderr, "%s: No socket-addr given\n", argv[0]);
|
|
963
|
+ fprintf(stderr, _("%s: No socket-addr given\n"), argv[0]);
|
964
|
964
|
return EX_USAGE;
|
965
|
965
|
}
|
966
|
966
|
port = argv[optind];
|
...
|
...
|
@@ -969,7 +992,7 @@ main(int argc, char **argv)
|
969
|
969
|
* Sanity checks on the clamav configuration file
|
970
|
970
|
*/
|
971
|
971
|
if((copt = parsecfg(cfgfile, 1)) == NULL) {
|
972
|
|
- fprintf(stderr, "%s: Can't parse the config file %s\n",
|
|
972
|
+ fprintf(stderr, _("%s: Can't parse the config file %s\n"),
|
973
|
973
|
argv[0], cfgfile);
|
974
|
974
|
return EX_CONFIG;
|
975
|
975
|
}
|
...
|
...
|
@@ -980,7 +1003,7 @@ main(int argc, char **argv)
|
980
|
980
|
if(getuid() == 0) {
|
981
|
981
|
if((cpt = cfgopt(copt, "User")) != NULL) {
|
982
|
982
|
if((user = getpwnam(cpt->strarg)) == NULL) {
|
983
|
|
- fprintf(stderr, "%s: Can't get information about user %s\n", argv[0], cpt->strarg);
|
|
983
|
+ fprintf(stderr, _("%s: Can't get information about user %s\n"), argv[0], cpt->strarg);
|
984
|
984
|
return EX_CONFIG;
|
985
|
985
|
}
|
986
|
986
|
|
...
|
...
|
@@ -991,7 +1014,7 @@ main(int argc, char **argv)
|
991
|
991
|
return EX_CONFIG;
|
992
|
992
|
}
|
993
|
993
|
#else
|
994
|
|
- fprintf(stderr, "%s: AllowSupplementaryGroups: initgroups not supported.\n",
|
|
994
|
+ fprintf(stderr, _("%s: AllowSupplementaryGroups: initgroups not supported.\n"),
|
995
|
995
|
argv[0]);
|
996
|
996
|
return EX_CONFIG;
|
997
|
997
|
#endif
|
...
|
...
|
@@ -1008,20 +1031,20 @@ main(int argc, char **argv)
|
1008
|
1008
|
if(setuid(user->pw_uid) < 0)
|
1009
|
1009
|
perror(cpt->strarg);
|
1010
|
1010
|
else
|
1011
|
|
- cli_dbgmsg("Running as user %s (UID %d, GID %d)\n",
|
|
1011
|
+ cli_dbgmsg(_("Running as user %s (UID %d, GID %d)\n"),
|
1012
|
1012
|
cpt->strarg, user->pw_uid, user->pw_gid);
|
1013
|
1013
|
} else
|
1014
|
|
- fprintf(stderr, "%s: running as root is not recommended (check \"User\" in clamav.conf)\n", argv[0]);
|
|
1014
|
+ fprintf(stderr, _("%s: running as root is not recommended (check \"User\" in clamav.conf)\n"), argv[0]);
|
1015
|
1015
|
}
|
1016
|
1016
|
if(advisory && quarantine) {
|
1017
|
|
- fprintf(stderr, "%s: Advisory mode doesn't work with quarantine mode\n", argv[0]);
|
|
1017
|
+ fprintf(stderr, _("%s: Advisory mode doesn't work with quarantine mode\n"), argv[0]);
|
1018
|
1018
|
return EX_USAGE;
|
1019
|
1019
|
}
|
1020
|
1020
|
if(quarantine_dir) {
|
1021
|
1021
|
struct stat statb;
|
1022
|
1022
|
|
1023
|
1023
|
if(advisory) {
|
1024
|
|
- fprintf(stderr, "%s: Advisory mode doesn't work with quarantine directories\n", argv[0]);
|
|
1024
|
+ fprintf(stderr, _("%s: Advisory mode doesn't work with quarantine directories\n"), argv[0]);
|
1025
|
1025
|
return EX_USAGE;
|
1026
|
1026
|
}
|
1027
|
1027
|
if(access(quarantine_dir, W_OK) < 0) {
|
...
|
...
|
@@ -1037,8 +1060,8 @@ main(int argc, char **argv)
|
1037
|
1037
|
* or writeable
|
1038
|
1038
|
*/
|
1039
|
1039
|
if(statb.st_mode & 077) {
|
1040
|
|
- fprintf(stderr, "%s: unsafe quarantine directory %s\n",
|
1041
|
|
- argv[0], quarantine_dir);
|
|
1040
|
+ fprintf(stderr, _("%s: insecure quarantine directory %s (mode 0%o)\n"),
|
|
1041
|
+ argv[0], quarantine_dir, statb.st_mode & 0777);
|
1042
|
1042
|
return EX_CONFIG;
|
1043
|
1043
|
}
|
1044
|
1044
|
}
|
...
|
...
|
@@ -1052,7 +1075,7 @@ main(int argc, char **argv)
|
1052
|
1052
|
}
|
1053
|
1053
|
|
1054
|
1054
|
if(!cfgopt(copt, "StreamSaveToDisk")) {
|
1055
|
|
- fprintf(stderr, "%s: StreamSavetoDisk not enabled in %s\n",
|
|
1055
|
+ fprintf(stderr, _("%s: StreamSavetoDisk not enabled in %s\n"),
|
1056
|
1056
|
argv[0], cfgfile);
|
1057
|
1057
|
return EX_CONFIG;
|
1058
|
1058
|
}
|
...
|
...
|
@@ -1062,7 +1085,7 @@ main(int argc, char **argv)
|
1062
|
1062
|
* In fact ScanMail isn't needed if this machine doesn't run
|
1063
|
1063
|
* clamd.
|
1064
|
1064
|
*/
|
1065
|
|
- fprintf(stderr, "%s: ScanMail not enabled in %s\n",
|
|
1065
|
+ fprintf(stderr, _("%s: ScanMail not enabled in %s\n"),
|
1066
|
1066
|
argv[0], cfgfile);
|
1067
|
1067
|
return EX_CONFIG;
|
1068
|
1068
|
}
|
...
|
...
|
@@ -1079,14 +1102,14 @@ main(int argc, char **argv)
|
1079
|
1079
|
readTimeout = cpt->numarg;
|
1080
|
1080
|
|
1081
|
1081
|
if(readTimeout < 0) {
|
1082
|
|
- fprintf(stderr, "%s: ReadTimeout must not be negative in %s\n",
|
|
1082
|
+ fprintf(stderr, _("%s: ReadTimeout must not be negative in %s\n"),
|
1083
|
1083
|
argv[0], cfgfile);
|
1084
|
1084
|
return EX_CONFIG;
|
1085
|
1085
|
}
|
1086
|
1086
|
}
|
1087
|
1087
|
if((cpt = cfgopt(copt, "StreamMaxLength")) != NULL) {
|
1088
|
1088
|
if(cpt->numarg < 0) {
|
1089
|
|
- fprintf(stderr, "%s: StreamMaxLength must not be negative in %s\n",
|
|
1089
|
+ fprintf(stderr, _("%s: StreamMaxLength must not be negative in %s\n"),
|
1090
|
1090
|
argv[0], cfgfile);
|
1091
|
1091
|
return EX_CONFIG;
|
1092
|
1092
|
}
|
...
|
...
|
@@ -1097,7 +1120,7 @@ main(int argc, char **argv)
|
1097
|
1097
|
*/
|
1098
|
1098
|
if((cpt = cfgopt(copt, "LocalSocket")) != NULL) {
|
1099
|
1099
|
if(cfgopt(copt, "TCPSocket") != NULL) {
|
1100
|
|
- fprintf(stderr, "%s: You can select one server type only (local/TCP) in %s\n",
|
|
1100
|
+ fprintf(stderr, _("%s: You can select one server type only (local/TCP) in %s\n"),
|
1101
|
1101
|
argv[0], cfgfile);
|
1102
|
1102
|
return EX_CONFIG;
|
1103
|
1103
|
}
|
...
|
...
|
@@ -1106,14 +1129,14 @@ main(int argc, char **argv)
|
1106
|
1106
|
*/
|
1107
|
1107
|
localSocket = cpt->strarg;
|
1108
|
1108
|
if(!pingServer(-1)) {
|
1109
|
|
- fprintf(stderr, "Can't talk to clamd server via %s\n",
|
|
1109
|
+ fprintf(stderr, _("Can't talk to clamd server via %s\n"),
|
1110
|
1110
|
localSocket);
|
1111
|
|
- fprintf(stderr, "Check your entry for LocalSocket in %s\n",
|
|
1111
|
+ fprintf(stderr, _("Check your entry for LocalSocket in %s\n"),
|
1112
|
1112
|
cfgfile);
|
1113
|
1113
|
return EX_CONFIG;
|
1114
|
1114
|
}
|
1115
|
1115
|
/*if(quarantine_dir == NULL)
|
1116
|
|
- fprintf(stderr, "When using Localsocket in %s\nyou may improve performance if you use the --quarantine-dir option\n", cfgfile);*/
|
|
1116
|
+ fprintf(stderr, _("When using Localsocket in %s\nyou may improve performance if you use the --quarantine-dir option\n"), cfgfile);*/
|
1117
|
1117
|
|
1118
|
1118
|
umask(077);
|
1119
|
1119
|
|
...
|
...
|
@@ -1126,7 +1149,7 @@ main(int argc, char **argv)
|
1126
|
1126
|
* TCPSocket is in fact a port number not a full socket
|
1127
|
1127
|
*/
|
1128
|
1128
|
if(quarantine_dir) {
|
1129
|
|
- fprintf(stderr, "%s: --quarantine-dir not supported for remote scanning - use --quarantine\n", argv[0]);
|
|
1129
|
+ fprintf(stderr, _("%s: --quarantine-dir not supported for remote scanning - use --quarantine\n"), argv[0]);
|
1130
|
1130
|
return EX_CONFIG;
|
1131
|
1131
|
}
|
1132
|
1132
|
|
...
|
...
|
@@ -1159,7 +1182,7 @@ main(int argc, char **argv)
|
1159
|
1159
|
const struct hostent *h = gethostbyname(hostname);
|
1160
|
1160
|
|
1161
|
1161
|
if(h == NULL) {
|
1162
|
|
- fprintf(stderr, "%s: Unknown host %s\n",
|
|
1162
|
+ fprintf(stderr, _("%s: Unknown host %s\n"),
|
1163
|
1163
|
argv[0], hostname);
|
1164
|
1164
|
return EX_USAGE;
|
1165
|
1165
|
}
|
...
|
...
|
@@ -1170,27 +1193,27 @@ main(int argc, char **argv)
|
1170
|
1170
|
if(pingServer(i))
|
1171
|
1171
|
activeServers++;
|
1172
|
1172
|
else {
|
1173
|
|
- cli_warnmsg("Can't talk to clamd server %s on port %d\n",
|
|
1173
|
+ cli_warnmsg(_("Can't talk to clamd server %s on port %d\n"),
|
1174
|
1174
|
hostname, tcpSocket);
|
1175
|
1175
|
}
|
1176
|
1176
|
free(hostname);
|
1177
|
1177
|
}
|
1178
|
1178
|
if(activeServers == 0) {
|
1179
|
|
- cli_errmsg("Can't find any clamd servers\n");
|
1180
|
|
- cli_errmsg("Check your entry for TCPSocket in %s\n",
|
|
1179
|
+ cli_errmsg(_("Can't find any clamd servers\n"));
|
|
1180
|
+ cli_errmsg(_("Check your entry for TCPSocket in %s\n"),
|
1181
|
1181
|
cfgfile);
|
1182
|
1182
|
return EX_CONFIG;
|
1183
|
1183
|
}
|
1184
|
1184
|
} else {
|
1185
|
|
- fprintf(stderr, "%s: You must select server type (local/TCP) in %s\n",
|
|
1185
|
+ fprintf(stderr, _("%s: You must select server type (local/TCP) in %s\n"),
|
1186
|
1186
|
argv[0], cfgfile);
|
1187
|
1187
|
return EX_CONFIG;
|
1188
|
1188
|
}
|
1189
|
1189
|
|
1190
|
1190
|
if(!cfgopt(copt, "Foreground")) {
|
1191
|
1191
|
#ifdef CL_DEBUG
|
1192
|
|
- printf("When debugging it is recommended that you use Foreground mode in %s\n", cfgfile);
|
1193
|
|
- puts("So that you can see all of the messages");
|
|
1192
|
+ printf(_("When debugging it is recommended that you use Foreground mode in %s\n"), cfgfile);
|
|
1193
|
+ puts(_("So that you can see all of the messages"));
|
1194
|
1194
|
#endif
|
1195
|
1195
|
|
1196
|
1196
|
switch(fork()) {
|
...
|
...
|
@@ -1236,16 +1259,16 @@ main(int argc, char **argv)
|
1236
|
1236
|
|
1237
|
1237
|
openlog("clamav-milter", LOG_CONS|LOG_PID, LOG_MAIL);
|
1238
|
1238
|
if(logVerbose)
|
1239
|
|
- syslog(LOG_INFO, "Starting: %s", clamav_version);
|
|
1239
|
+ syslog(LOG_INFO, _("Starting: %s"), clamav_version);
|
1240
|
1240
|
else
|
1241
|
1241
|
syslog(LOG_INFO, "%s", clamav_version);
|
1242
|
1242
|
#ifdef CL_DEBUG
|
1243
|
1243
|
if(debug_level > 0)
|
1244
|
|
- syslog(LOG_DEBUG, "Debugging is on");
|
|
1244
|
+ syslog(LOG_DEBUG, _("Debugging is on"));
|
1245
|
1245
|
#endif
|
1246
|
1246
|
} else {
|
1247
|
1247
|
if(qflag)
|
1248
|
|
- fprintf(stderr, "%s: (-q && !LogSyslog): warning - all interception message methods are off\n",
|
|
1248
|
+ fprintf(stderr, _("%s: (-q && !LogSyslog): warning - all interception message methods are off\n"),
|
1249
|
1249
|
argv[0]);
|
1250
|
1250
|
use_syslog = 0;
|
1251
|
1251
|
}
|
...
|
...
|
@@ -1257,9 +1280,9 @@ main(int argc, char **argv)
|
1257
|
1257
|
|
1258
|
1258
|
if((fd = fopen(pidfile, "w")) == NULL) {
|
1259
|
1259
|
if(use_syslog)
|
1260
|
|
- syslog(LOG_WARNING, "Can't save PID in file %s",
|
|
1260
|
+ syslog(LOG_WARNING, _("Can't save PID in file %s"),
|
1261
|
1261
|
pidfile);
|
1262
|
|
- cli_warnmsg("Can't save PID in file %s\n", pidfile);
|
|
1262
|
+ cli_warnmsg(_("Can't save PID in file %s\n"), pidfile);
|
1263
|
1263
|
} else {
|
1264
|
1264
|
fprintf(fd, "%d\n", (int)getpid());
|
1265
|
1265
|
fclose(fd);
|
...
|
...
|
@@ -1287,7 +1310,7 @@ main(int argc, char **argv)
|
1287
|
1287
|
}
|
1288
|
1288
|
|
1289
|
1289
|
if(smfi_setconn(port) == MI_FAILURE) {
|
1290
|
|
- fprintf(stderr, "%s: smfi_setconn failed\n",
|
|
1290
|
+ fprintf(stderr, _("%s: smfi_setconn failed\n"),
|
1291
|
1291
|
argv[0]);
|
1292
|
1292
|
return EX_SOFTWARE;
|
1293
|
1293
|
}
|
...
|
...
|
@@ -1300,7 +1323,7 @@ main(int argc, char **argv)
|
1300
|
1300
|
signal(SIGPIPE, SIG_IGN);
|
1301
|
1301
|
|
1302
|
1302
|
if(logVerbose)
|
1303
|
|
- syslog(LOG_INFO, "Started: %s", clamav_version);
|
|
1303
|
+ syslog(LOG_INFO, _("Started: %s"), clamav_version);
|
1304
|
1304
|
|
1305
|
1305
|
return smfi_main();
|
1306
|
1306
|
}
|
...
|
...
|
@@ -1472,10 +1495,10 @@ findServer(void)
|
1472
|
1472
|
if((connect(sock, (struct sockaddr *)server, sizeof(struct sockaddr)) < 0) ||
|
1473
|
1473
|
(send(sock, "PING\n", 5, 0) < 5)) {
|
1474
|
1474
|
char *hostname = cli_strtok(serverHostNames, i, ":");
|
1475
|
|
- cli_warnmsg("Check clamd server %s - it may be down\n", hostname);
|
|
1475
|
+ cli_warnmsg(_("Check clamd server %s - it may be down\n"), hostname);
|
1476
|
1476
|
if(use_syslog)
|
1477
|
1477
|
syslog(LOG_WARNING,
|
1478
|
|
- "Check clamd server %s - it may be down",
|
|
1478
|
+ _("Check clamd server %s - it may be down"),
|
1479
|
1479
|
hostname);
|
1480
|
1480
|
close(sock);
|
1481
|
1481
|
free(hostname);
|
...
|
...
|
@@ -1519,9 +1542,9 @@ findServer(void)
|
1519
|
1519
|
* no more than say one message every 15 minutes
|
1520
|
1520
|
*/
|
1521
|
1521
|
free(socks);
|
1522
|
|
- cli_dbgmsg("findServer: No response from any server\n");
|
|
1522
|
+ cli_dbgmsg(_("findServer: No response from any server\n"));
|
1523
|
1523
|
if(use_syslog)
|
1524
|
|
- syslog(LOG_WARNING, "findServer: No response from any server");
|
|
1524
|
+ syslog(LOG_WARNING, _("findServer: No response from any server"));
|
1525
|
1525
|
|
1526
|
1526
|
time(&thistime);
|
1527
|
1527
|
pthread_mutex_lock(&time_mutex);
|
...
|
...
|
@@ -1539,17 +1562,17 @@ findServer(void)
|
1539
|
1539
|
if(sendmail) {
|
1540
|
1540
|
fprintf(sendmail, "To: %s\n", postmaster);
|
1541
|
1541
|
fprintf(sendmail, "From: %s\n", postmaster);
|
1542
|
|
- fputs("Subject: ClamAV Down\n", sendmail);
|
|
1542
|
+ fputs(_("Subject: ClamAV Down\n"), sendmail);
|
1543
|
1543
|
fputs("Priority: High\n\n", sendmail);
|
1544
|
1544
|
|
1545
|
|
- fputs("This is an automatic message\n\n", sendmail);
|
|
1545
|
+ fputs(_("This is an automatic message\n\n"), sendmail);
|
1546
|
1546
|
|
1547
|
1547
|
if(numServers == 1)
|
1548
|
|
- fputs("The clamd program cannot be contacted.\n", sendmail);
|
|
1548
|
+ fputs(_("The clamd program cannot be contacted.\n"), sendmail);
|
1549
|
1549
|
else
|
1550
|
|
- fputs("No clamd server can be contacted.\n", sendmail);
|
|
1550
|
+ fputs(_("No clamd server can be contacted.\n"), sendmail);
|
1551
|
1551
|
|
1552
|
|
- fputs("Emails may not be being scanned, please check your servers.\n", sendmail);
|
|
1552
|
+ fputs(_("Emails may not be being scanned, please check your servers.\n"), sendmail);
|
1553
|
1553
|
|
1554
|
1554
|
if(pclose(sendmail) == 0) {
|
1555
|
1555
|
pthread_mutex_lock(&time_mutex);
|
...
|
...
|
@@ -1562,7 +1585,7 @@ findServer(void)
|
1562
|
1562
|
} else if(retval < 0) {
|
1563
|
1563
|
free(socks);
|
1564
|
1564
|
if(use_syslog)
|
1565
|
|
- syslog(LOG_ERR, "findServer: select failed");
|
|
1565
|
+ syslog(LOG_ERR, _("findServer: select failed"));
|
1566
|
1566
|
return 0;
|
1567
|
1567
|
}
|
1568
|
1568
|
|
...
|
...
|
@@ -1571,14 +1594,14 @@ findServer(void)
|
1571
|
1571
|
const int s = (i + j) % numServers;
|
1572
|
1572
|
|
1573
|
1573
|
free(socks);
|
1574
|
|
- cli_dbgmsg("findServer: using server %d\n", s);
|
|
1574
|
+ cli_dbgmsg(_("findServer: using server %d\n"), s);
|
1575
|
1575
|
return s;
|
1576
|
1576
|
}
|
1577
|
1577
|
|
1578
|
1578
|
free(socks);
|
1579
|
|
- cli_dbgmsg("findServer: No response from any server\n");
|
|
1579
|
+ cli_dbgmsg(_("findServer: No response from any server\n"));
|
1580
|
1580
|
if(use_syslog)
|
1581
|
|
- syslog(LOG_WARNING, "findServer: No response from any server");
|
|
1581
|
+ syslog(LOG_WARNING, _("findServer: No response from any server"));
|
1582
|
1582
|
return 0;
|
1583
|
1583
|
}
|
1584
|
1584
|
|
...
|
...
|
@@ -1591,16 +1614,16 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1591
|
1591
|
#if defined(HAVE_INET_NTOP) || defined(WITH_TCPWRAP)
|
1592
|
1592
|
char ip[INET_ADDRSTRLEN]; /* IPv4 only */
|
1593
|
1593
|
#endif
|
1594
|
|
- char *remoteIP;
|
|
1594
|
+ const char *remoteIP;
|
1595
|
1595
|
|
1596
|
1596
|
if(ctx == NULL) {
|
1597
|
1597
|
if(use_syslog)
|
1598
|
|
- syslog(LOG_ERR, "clamfi_connect: ctx is null");
|
|
1598
|
+ syslog(LOG_ERR, _("clamfi_connect: ctx is null"));
|
1599
|
1599
|
return cl_error;
|
1600
|
1600
|
}
|
1601
|
1601
|
if(hostname == NULL) {
|
1602
|
1602
|
if(use_syslog)
|
1603
|
|
- syslog(LOG_ERR, "clamfi_connect: hostname is null");
|
|
1603
|
+ syslog(LOG_ERR, _("clamfi_connect: hostname is null"));
|
1604
|
1604
|
return cl_error;
|
1605
|
1605
|
}
|
1606
|
1606
|
if((hostaddr == NULL) || (&(((struct sockaddr_in *)(hostaddr))->sin_addr) == NULL))
|
...
|
...
|
@@ -1621,7 +1644,7 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1621
|
1621
|
|
1622
|
1622
|
if(remoteIP == NULL) {
|
1623
|
1623
|
if(use_syslog)
|
1624
|
|
- syslog(LOG_ERR, "clamfi_connect: remoteIP is null");
|
|
1624
|
+ syslog(LOG_ERR, _("clamfi_connect: remoteIP is null"));
|
1625
|
1625
|
return cl_error;
|
1626
|
1626
|
}
|
1627
|
1627
|
}
|
...
|
...
|
@@ -1629,8 +1652,8 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1629
|
1629
|
#ifdef CL_DEBUG
|
1630
|
1630
|
if(debug_level >= 4) {
|
1631
|
1631
|
if(use_syslog)
|
1632
|
|
- syslog(LOG_NOTICE, "clamfi_connect: connection from %s [%s]", hostname, remoteIP);
|
1633
|
|
- cli_dbgmsg("clamfi_connect: connection from %s [%s]\n", hostname, remoteIP);
|
|
1632
|
+ syslog(LOG_NOTICE, _("clamfi_connect: connection from %s [%s]"), hostname, remoteIP);
|
|
1633
|
+ cli_dbgmsg(_("clamfi_connect: connection from %s [%s]\n"), hostname, remoteIP);
|
1634
|
1634
|
}
|
1635
|
1635
|
#endif
|
1636
|
1636
|
|
...
|
...
|
@@ -1649,12 +1672,12 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1649
|
1649
|
*/
|
1650
|
1650
|
if((hostmail = smfi_getsymval(ctx, "{if_name}")) == NULL) {
|
1651
|
1651
|
if(use_syslog)
|
1652
|
|
- syslog(LOG_ERR, "Can't get sendmail hostname");
|
|
1652
|
+ syslog(LOG_ERR, _("Can't get sendmail hostname"));
|
1653
|
1653
|
return cl_error;
|
1654
|
1654
|
}
|
1655
|
1655
|
if(clamfi_gethostbyname(hostmail, &hostent, buf, sizeof(buf)) != 0) {
|
1656
|
1656
|
if(use_syslog)
|
1657
|
|
- syslog(LOG_WARNING, "Access Denied: Host Unknown (%s)", hostname);
|
|
1657
|
+ syslog(LOG_WARNING, _("Access Denied: Host Unknown (%s)"), hostname);
|
1658
|
1658
|
return cl_error;
|
1659
|
1659
|
}
|
1660
|
1660
|
|
...
|
...
|
@@ -1664,7 +1687,7 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1664
|
1664
|
perror(hostent.h_name);
|
1665
|
1665
|
/*strcpy(ip, (char *)inet_ntoa(*(struct in_addr *)hostent.h_addr));*/
|
1666
|
1666
|
if(use_syslog)
|
1667
|
|
- syslog(LOG_WARNING, "Access Denied: Can't get IP address for (%s)", hostent.h_name);
|
|
1667
|
+ syslog(LOG_WARNING, _("Access Denied: Can't get IP address for (%s)"), hostent.h_name);
|
1668
|
1668
|
return cl_error;
|
1669
|
1669
|
}
|
1670
|
1670
|
#else
|
...
|
...
|
@@ -1681,7 +1704,7 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1681
|
1681
|
if(!hosts_ctl("clamav-milter", hostent.h_name, ip, STRING_UNKNOWN)) {
|
1682
|
1682
|
pthread_mutex_unlock(&wrap_mutex);
|
1683
|
1683
|
if(use_syslog)
|
1684
|
|
- syslog(LOG_WARNING, "Access Denied for %s[%s]", hostent.h_name, ip);
|
|
1684
|
+ syslog(LOG_WARNING, _("Access Denied for %s[%s]"), hostent.h_name, ip);
|
1685
|
1685
|
return SMFIS_TEMPFAIL;
|
1686
|
1686
|
}
|
1687
|
1687
|
pthread_mutex_unlock(&wrap_mutex);
|
...
|
...
|
@@ -1699,8 +1722,8 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1699
|
1699
|
if(strcmp(remoteIP, "127.0.0.1") == 0) {
|
1700
|
1700
|
#ifdef CL_DEBUG
|
1701
|
1701
|
if(use_syslog)
|
1702
|
|
- syslog(LOG_DEBUG, "clamfi_connect: not scanning outgoing messages");
|
1703
|
|
- cli_dbgmsg("clamfi_connect: not scanning outgoing messages\n");
|
|
1702
|
+ syslog(LOG_DEBUG, _("clamfi_connect: not scanning outgoing messages"));
|
|
1703
|
+ cli_dbgmsg(_("clamfi_connect: not scanning outgoing messages\n"));
|
1704
|
1704
|
#endif
|
1705
|
1705
|
return SMFIS_ACCEPT;
|
1706
|
1706
|
}
|
...
|
...
|
@@ -1708,8 +1731,8 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
|
1708
|
1708
|
if((!lflag) && isLocalAddr(inet_addr(remoteIP))) {
|
1709
|
1709
|
#ifdef CL_DEBUG
|
1710
|
1710
|
if(use_syslog)
|
1711
|
|
- syslog(LOG_DEBUG, "clamfi_connect: not scanning local messages");
|
1712
|
|
- cli_dbgmsg("clamfi_connect: not scanning outgoing messages\n");
|
|
1711
|
+ syslog(LOG_DEBUG, _("clamfi_connect: not scanning local messages"));
|
|
1712
|
+ cli_dbgmsg(_("clamfi_connect: not scanning outgoing messages\n"));
|
1713
|
1713
|
#endif
|
1714
|
1714
|
return SMFIS_ACCEPT;
|
1715
|
1715
|
}
|
...
|
...
|
@@ -1745,13 +1768,13 @@ clamfi_envfrom(SMFICTX *ctx, char **argv)
|
1745
|
1745
|
if(use_syslog)
|
1746
|
1746
|
syslog(LOG_NOTICE,
|
1747
|
1747
|
((dont_wait) ?
|
1748
|
|
- "hit max-children limit (%u >= %u)" :
|
1749
|
|
- "hit max-children limit (%u >= %u): waiting for some to exit"),
|
|
1748
|
+ _("hit max-children limit (%u >= %u)") :
|
|
1749
|
+ _("hit max-children limit (%u >= %u): waiting for some to exit")),
|
1750
|
1750
|
n_children, max_children);
|
1751
|
1751
|
|
1752
|
1752
|
if(dont_wait) {
|
1753
|
1753
|
pthread_mutex_unlock(&n_children_mutex);
|
1754
|
|
- smfi_setreply(ctx, "451", "4.3.2", "AV system temporarily overloaded - please try later");
|
|
1754
|
+ smfi_setreply(ctx, "451", "4.3.2", _("AV system temporarily overloaded - please try later"));
|
1755
|
1755
|
return SMFIS_TEMPFAIL;
|
1756
|
1756
|
}
|
1757
|
1757
|
/*
|
...
|
...
|
@@ -1781,15 +1804,15 @@ clamfi_envfrom(SMFICTX *ctx, char **argv)
|
1781
|
1781
|
}
|
1782
|
1782
|
n_children++;
|
1783
|
1783
|
|
1784
|
|
- cli_dbgmsg(">n_children = %d\n", n_children);
|
|
1784
|
+ cli_dbgmsg(_(">n_children = %d\n"), n_children);
|
1785
|
1785
|
pthread_mutex_unlock(&n_children_mutex);
|
1786
|
1786
|
|
1787
|
1787
|
if(child_timeout && (rc == ETIMEDOUT)) {
|
1788
|
1788
|
#ifdef CL_DEBUG
|
1789
|
1789
|
if(use_syslog)
|
1790
|
|
- syslog(LOG_NOTICE, "Timeout waiting for a child to die");
|
|
1790
|
+ syslog(LOG_NOTICE, _("Timeout waiting for a child to die"));
|
1791
|
1791
|
#endif
|
1792
|
|
- cli_dbgmsg("Timeout waiting for a child to die\n");
|
|
1792
|
+ cli_dbgmsg(_("Timeout waiting for a child to die\n"));
|
1793
|
1793
|
}
|
1794
|
1794
|
}
|
1795
|
1795
|
|
...
|
...
|
@@ -1906,10 +1929,10 @@ clamfi_eoh(SMFICTX *ctx)
|
1906
|
1906
|
char **to;
|
1907
|
1907
|
|
1908
|
1908
|
if(logVerbose)
|
1909
|
|
- syslog(LOG_DEBUG, "clamfi_eoh");
|
|
1909
|
+ syslog(LOG_DEBUG, _("clamfi_eoh"));
|
1910
|
1910
|
#ifdef CL_DEBUG
|
1911
|
1911
|
if(debug_level >= 4)
|
1912
|
|
- cli_dbgmsg("clamfi_eoh\n");
|
|
1912
|
+ cli_dbgmsg(_("clamfi_eoh\n"));
|
1913
|
1913
|
#endif
|
1914
|
1914
|
|
1915
|
1915
|
/*
|
...
|
...
|
@@ -1966,9 +1989,9 @@ clamfi_eoh(SMFICTX *ctx)
|
1966
|
1966
|
* must be on the white list, so just accept the e-mail
|
1967
|
1967
|
*/
|
1968
|
1968
|
if(use_syslog)
|
1969
|
|
- syslog(LOG_NOTICE, "clamfi_eoh: ignoring whitelisted message");
|
|
1969
|
+ syslog(LOG_NOTICE, _("clamfi_eoh: ignoring whitelisted message"));
|
1970
|
1970
|
#ifdef CL_DEBUG
|
1971
|
|
- cli_dbgmsg("clamfi_eoh: not scanning outgoing messages\n");
|
|
1971
|
+ cli_dbgmsg(_("clamfi_eoh: not scanning outgoing messages\n"));
|
1972
|
1972
|
#endif
|
1973
|
1973
|
clamfi_cleanup(ctx);
|
1974
|
1974
|
|
...
|
...
|
@@ -1982,9 +2005,9 @@ clamfi_body(SMFICTX *ctx, u_char *bodyp, size_t len)
|
1982
|
1982
|
int nbytes;
|
1983
|
1983
|
|
1984
|
1984
|
if(logVerbose)
|
1985
|
|
- syslog(LOG_DEBUG, "clamfi_envbody: %u bytes", len);
|
|
1985
|
+ syslog(LOG_DEBUG, _("clamfi_envbody: %u bytes"), len);
|
1986
|
1986
|
#ifdef CL_DEBUG
|
1987
|
|
- cli_dbgmsg("clamfi_envbody: %u bytes\n", len);
|
|
1987
|
+ cli_dbgmsg(_("clamfi_envbody: %u bytes\n"), len);
|
1988
|
1988
|
#endif
|
1989
|
1989
|
|
1990
|
1990
|
nbytes = clamfi_send(privdata, len, (char *)bodyp);
|
...
|
...
|
@@ -1994,11 +2017,11 @@ clamfi_body(SMFICTX *ctx, u_char *bodyp, size_t len)
|
1994
|
1994
|
const char *sendmailId = smfi_getsymval(ctx, "i");
|
1995
|
1995
|
if(sendmailId == NULL)
|
1996
|
1996
|
sendmailId = "Unknown";
|
1997
|
|
- syslog(LOG_NOTICE, "%s: Message more than StreamMaxLength (%ld) bytes - not scanned",
|
|
1997
|
+ syslog(LOG_NOTICE, _("%s: Message more than StreamMaxLength (%ld) bytes - not scanned"),
|
1998
|
1998
|
sendmailId, streamMaxLength);
|
1999
|
1999
|
}
|
2000
|
2000
|
if(!nflag)
|
2001
|
|
- smfi_addheader(ctx, "X-Virus-Status", "Not Scanned - StreamMaxLength exceeded");
|
|
2001
|
+ smfi_addheader(ctx, "X-Virus-Status", _("Not Scanned - StreamMaxLength exceeded"));
|
2002
|
2002
|
|
2003
|
2003
|
return SMFIS_ACCEPT; /* clamfi_close will be called */
|
2004
|
2004
|
}
|
...
|
...
|
@@ -2078,7 +2101,7 @@ clamfi_eom(SMFICTX *ctx)
|
2078
|
2078
|
perror("send");
|
2079
|
2079
|
clamfi_cleanup(ctx);
|
2080
|
2080
|
if(use_syslog)
|
2081
|
|
- syslog(LOG_ERR, "send failed to clamd");
|
|
2081
|
+ syslog(LOG_ERR, _("send failed to clamd"));
|
2082
|
2082
|
return cl_error;
|
2083
|
2083
|
}
|
2084
|
2084
|
|
...
|
...
|
@@ -2090,8 +2113,8 @@ clamfi_eom(SMFICTX *ctx)
|
2090
|
2090
|
*ptr = '\0';
|
2091
|
2091
|
|
2092
|
2092
|
if(logVerbose)
|
2093
|
|
- syslog(LOG_DEBUG, "clamfi_eom: read %s", mess);
|
2094
|
|
- cli_dbgmsg("clamfi_eom: read %s\n", mess);
|
|
2093
|
+ syslog(LOG_DEBUG, _("clamfi_eom: read %s"), mess);
|
|
2094
|
+ cli_dbgmsg(_("clamfi_eom: read %s\n"), mess);
|
2095
|
2095
|
} else {
|
2096
|
2096
|
/*
|
2097
|
2097
|
* TODO: if more than one host has been specified, try
|
...
|
...
|
@@ -2099,9 +2122,9 @@ clamfi_eom(SMFICTX *ctx)
|
2099
|
2099
|
* by forcing a retry
|
2100
|
2100
|
*/
|
2101
|
2101
|
clamfi_cleanup(ctx);
|
2102
|
|
- syslog(LOG_NOTICE, "clamfi_eom: read nothing from clamd");
|
|
2102
|
+ syslog(LOG_NOTICE, _("clamfi_eom: read nothing from clamd"));
|
2103
|
2103
|
#ifdef CL_DEBUG
|
2104
|
|
- cli_dbgmsg("clamfi_eom: read nothing from clamd\n");
|
|
2104
|
+ cli_dbgmsg(_("clamfi_eom: read nothing from clamd\n"));
|
2105
|
2105
|
#endif
|
2106
|
2106
|
return cl_error;
|
2107
|
2107
|
}
|
...
|
...
|
@@ -2129,7 +2152,7 @@ clamfi_eom(SMFICTX *ctx)
|
2129
|
2129
|
strncpy(hostname, j,
|
2130
|
2130
|
sizeof(hostname) - 1);
|
2131
|
2131
|
else
|
2132
|
|
- strcpy(buf, "Error determining host");
|
|
2132
|
+ strcpy(buf, _("Error determining host"));
|
2133
|
2133
|
} else if(strchr(hostname, '.') == NULL) {
|
2134
|
2134
|
/*
|
2135
|
2135
|
* Determine fully qualified name
|
...
|
...
|
@@ -2152,7 +2175,7 @@ clamfi_eom(SMFICTX *ctx)
|
2152
|
2152
|
free(hostname);
|
2153
|
2153
|
} else
|
2154
|
2154
|
/* sanity check failed - should issue warning */
|
2155
|
|
- strcpy(buf, "Error determining host");
|
|
2155
|
+ strcpy(buf, _("Error determining host"));
|
2156
|
2156
|
}
|
2157
|
2157
|
smfi_addheader(ctx, "X-Virus-Scanned", buf);
|
2158
|
2158
|
}
|
...
|
...
|
@@ -2163,15 +2186,15 @@ clamfi_eom(SMFICTX *ctx)
|
2163
|
2163
|
* Clamd has stopped on StreamMaxLength before us
|
2164
|
2164
|
*/
|
2165
|
2165
|
if(use_syslog)
|
2166
|
|
- syslog(LOG_NOTICE, "%s: Message more than StreamMaxLength (%ld) bytes - not scanned",
|
|
2166
|
+ syslog(LOG_NOTICE, _("%s: Message more than StreamMaxLength (%ld) bytes - not scanned"),
|
2167
|
2167
|
sendmailId, streamMaxLength);
|
2168
|
2168
|
if(!nflag)
|
2169
|
|
- smfi_addheader(ctx, "X-Virus-Status", "Not Scanned - StreamMaxLength exceeded");
|
|
2169
|
+ smfi_addheader(ctx, "X-Virus-Status", _("Not Scanned - StreamMaxLength exceeded"));
|
2170
|
2170
|
clamfi_cleanup(ctx); /* not needed, but just to be safe */
|
2171
|
2171
|
return SMFIS_ACCEPT;
|
2172
|
2172
|
}
|
2173
|
2173
|
if(!nflag)
|
2174
|
|
- smfi_addheader(ctx, "X-Virus-Status", "Not Scanned");
|
|
2174
|
+ smfi_addheader(ctx, "X-Virus-Status", _("Not Scanned"));
|
2175
|
2175
|
|
2176
|
2176
|
cli_warnmsg("%s: %s\n", sendmailId, mess);
|
2177
|
2177
|
if(use_syslog)
|
...
|
...
|
@@ -2182,13 +2205,13 @@ clamfi_eom(SMFICTX *ctx)
|
2182
|
2182
|
|
2183
|
2183
|
if((ptr = strstr(mess, "FOUND")) == NULL) {
|
2184
|
2184
|
if(!nflag)
|
2185
|
|
- smfi_addheader(ctx, "X-Virus-Status", "Clean");
|
|
2185
|
+ smfi_addheader(ctx, "X-Virus-Status", _("Clean"));
|
2186
|
2186
|
|
2187
|
2187
|
if(use_syslog && logClean)
|
2188
|
2188
|
/* Include the sendmail queue ID in the log */
|
2189
|
|
- syslog(LOG_NOTICE, "%s: clean message from %s",
|
|
2189
|
+ syslog(LOG_NOTICE, _("%s: clean message from %s"),
|
2190
|
2190
|
sendmailId,
|
2191
|
|
- (privdata->from) ? privdata->from : "an unknown sender");
|
|
2191
|
+ (privdata->from) ? privdata->from : _("an unknown sender"));
|
2192
|
2192
|
|
2193
|
2193
|
if(privdata->body) {
|
2194
|
2194
|
/*
|
...
|
...
|
@@ -2222,7 +2245,7 @@ clamfi_eom(SMFICTX *ctx)
|
2222
|
2222
|
virusname = mess;
|
2223
|
2223
|
|
2224
|
2224
|
if(!nflag)
|
2225
|
|
- smfi_addheader(ctx, "X-Virus-Status", "Infected");
|
|
2225
|
+ smfi_addheader(ctx, "X-Virus-Status", _("Infected"));
|
2226
|
2226
|
|
2227
|
2227
|
if(use_syslog) {
|
2228
|
2228
|
/*
|
...
|
...
|
@@ -2240,7 +2263,7 @@ clamfi_eom(SMFICTX *ctx)
|
2240
|
2240
|
* Use snprintf rather than printf since we don't know the
|
2241
|
2241
|
* length of privdata->from and may get a buffer overrun
|
2242
|
2242
|
*/
|
2243
|
|
- snprintf(err, 1023, "Intercepted virus from %s to",
|
|
2243
|
+ snprintf(err, 1023, _("Intercepted virus from %s to"),
|
2244
|
2244
|
privdata->from);
|
2245
|
2245
|
|
2246
|
2246
|
ptr = strchr(err, '\0');
|
...
|
...
|
@@ -2331,7 +2354,7 @@ clamfi_eom(SMFICTX *ctx)
|
2331
|
2331
|
fprintf(sendmail,
|
2332
|
2332
|
"X-Infected-Received-From: %s\n",
|
2333
|
2333
|
ptr);
|
2334
|
|
- fputs("Subject: Virus intercepted\n\n", sendmail);
|
|
2334
|
+ fputs(_("Subject: Virus intercepted\n\n"), sendmail);
|
2335
|
2335
|
|
2336
|
2336
|
if((templatefile == NULL) ||
|
2337
|
2337
|
(sendtemplate(ctx, templatefile, sendmail, virusname) < 0)) {
|
...
|
...
|
@@ -2353,32 +2376,32 @@ clamfi_eom(SMFICTX *ctx)
|
2353
|
2353
|
sender = smfi_getsymval(ctx, "_");
|
2354
|
2354
|
|
2355
|
2355
|
if(bflag)
|
2356
|
|
- fputs("A message you sent to\n", sendmail);
|
|
2356
|
+ fputs(_("A message you sent to\n"), sendmail);
|
2357
|
2357
|
else if(pflag)
|
2358
|
2358
|
/*
|
2359
|
2359
|
* The message is only going to
|
2360
|
2360
|
* the postmaster, so include
|
2361
|
2361
|
* some useful information
|
2362
|
2362
|
*/
|
2363
|
|
- fprintf(sendmail, "The message %s sent from %s to\n",
|
|
2363
|
+ fprintf(sendmail, _("The message %1$s sent from %2$s to\n"),
|
2364
|
2364
|
sendmailId, sender);
|
2365
|
2365
|
else
|
2366
|
|
- fprintf(sendmail, "A message sent from %s to\n",
|
|
2366
|
+ fprintf(sendmail, _("A message sent from %s to\n"),
|
2367
|
2367
|
sender);
|
2368
|
2368
|
|
2369
|
2369
|
for(to = privdata->to; *to; to++)
|
2370
|
2370
|
fprintf(sendmail, "\t%s\n", *to);
|
2371
|
|
- fprintf(sendmail, "contained %s and has not been delivered.\n", virusname);
|
|
2371
|
+ fprintf(sendmail, _("contained %s and has not been delivered.\n"), virusname);
|
2372
|
2372
|
|
2373
|
2373
|
if(privdata->filename != NULL)
|
2374
|
2374
|
if(qfile(privdata, virusname) == 0)
|
2375
|
|
- fprintf(sendmail, "\nThe message in question has been quarantined as %s\n", privdata->filename);
|
|
2375
|
+ fprintf(sendmail, _("\nThe message in question has been quarantined as %s\n"), privdata->filename);
|
2376
|
2376
|
|
2377
|
2377
|
if(hflag) {
|
2378
|
|
- fprintf(sendmail, "\nThe message was received by %s from %s via %s\n\n",
|
|
2378
|
+ fprintf(sendmail, _("\nThe message was received by %1$s from %2$s via %3$s\n\n"),
|
2379
|
2379
|
smfi_getsymval(ctx, "j"), sender,
|
2380
|
2380
|
smfi_getsymval(ctx, "_"));
|
2381
|
|
- fputs("For your information, the original message headers were:\n\n", sendmail);
|
|
2381
|
+ fputs(_("For your information, the original message headers were:\n\n"), sendmail);
|
2382
|
2382
|
header_list_print(privdata->headers, sendmail);
|
2383
|
2383
|
} else if(privdata->received)
|
2384
|
2384
|
/*
|
...
|
...
|
@@ -2391,7 +2414,7 @@ clamfi_eom(SMFICTX *ctx)
|
2391
|
2391
|
* we can do if that DHCP has
|
2392
|
2392
|
* set the hostname...
|
2393
|
2393
|
*/
|
2394
|
|
- fprintf(sendmail, "\nThe infected machine is likely to be here:\n%s\t\n",
|
|
2394
|
+ fprintf(sendmail, _("\nThe infected machine is likely to be here:\n%s\t\n"),
|
2395
|
2395
|
privdata->received);
|
2396
|
2396
|
|
2397
|
2397
|
}
|
...
|
...
|
@@ -2404,7 +2427,7 @@ clamfi_eom(SMFICTX *ctx)
|
2404
|
2404
|
assert(quarantine_dir != NULL);
|
2405
|
2405
|
|
2406
|
2406
|
if(use_syslog)
|
2407
|
|
- syslog(LOG_NOTICE, "Quarantined infected mail as %s", privdata->filename);
|
|
2407
|
+ syslog(LOG_NOTICE, _("Quarantined infected mail as %s"), privdata->filename);
|
2408
|
2408
|
/*
|
2409
|
2409
|
* Cleanup filename here otherwise clamfi_free() will
|
2410
|
2410
|
* delete the file that we wish to keep because it
|
...
|
...
|
@@ -2428,9 +2451,9 @@ clamfi_eom(SMFICTX *ctx)
|
2428
|
2428
|
*/
|
2429
|
2429
|
if(smfi_addrcpt(ctx, quarantine) == MI_FAILURE) {
|
2430
|
2430
|
if(use_syslog)
|
2431
|
|
- syslog(LOG_DEBUG, "Can't set quarantine user %s", quarantine);
|
|
2431
|
+ syslog(LOG_DEBUG, _("Can't set quarantine user %s"), quarantine);
|
2432
|
2432
|
else
|
2433
|
|
- cli_warnmsg("Can't set quarantine user %s\n", quarantine);
|
|
2433
|
+ cli_warnmsg(_("Can't set quarantine user %s\n"), quarantine);
|
2434
|
2434
|
} else
|
2435
|
2435
|
setsubject(ctx, virusname);
|
2436
|
2436
|
} else if(advisory)
|
...
|
...
|
@@ -2443,7 +2466,7 @@ clamfi_eom(SMFICTX *ctx)
|
2443
|
2443
|
} else
|
2444
|
2444
|
rc = SMFIS_DISCARD;
|
2445
|
2445
|
|
2446
|
|
- snprintf(reject, sizeof(reject) - 1, "%s detected by ClamAV - http://www.clamav.net", virusname);
|
|
2446
|
+ snprintf(reject, sizeof(reject) - 1, _("%s detected by ClamAV - http://www.clamav.net"), virusname);
|
2447
|
2447
|
smfi_setreply(ctx, (char *)privdata->rejectCode, "5.7.1", reject);
|
2448
|
2448
|
}
|
2449
|
2449
|
clamfi_cleanup(ctx);
|
...
|
...
|
@@ -2522,7 +2545,7 @@ clamfi_free(struct privdata *privdata)
|
2522
|
2522
|
perror(privdata->filename);
|
2523
|
2523
|
if(use_syslog)
|
2524
|
2524
|
syslog(LOG_ERR,
|
2525
|
|
- "Can't remove clean file %s",
|
|
2525
|
+ _("Can't remove clean file %s"),
|
2526
|
2526
|
privdata->filename);
|
2527
|
2527
|
}
|
2528
|
2528
|
free(privdata->filename);
|
...
|
...
|
@@ -2652,10 +2675,10 @@ clamfi_send(struct privdata *privdata, size_t len, const char *format, ...)
|
2652
|
2652
|
char buf[32];
|
2653
|
2653
|
strerror_r(errno, buf, sizeof(buf));
|
2654
|
2654
|
syslog(LOG_ERR,
|
2655
|
|
- "write failure (%u bytes) to %s: %s",
|
|
2655
|
+ _("write failure (%u bytes) to %s: %s"),
|
2656
|
2656
|
len, privdata->filename, buf);
|
2657
|
2657
|
#else
|
2658
|
|
- syslog(LOG_ERR, "write failure (%u bytes) to %s: %s",
|
|
2658
|
+ syslog(LOG_ERR, _("write failure (%u bytes) to %s: %s"),
|
2659
|
2659
|
len, privdata->filename,
|
2660
|
2660
|
strerror(errno));
|
2661
|
2661
|
#endif
|
...
|
...
|
@@ -2669,10 +2692,10 @@ clamfi_send(struct privdata *privdata, size_t len, const char *format, ...)
|
2669
|
2669
|
char buf[32];
|
2670
|
2670
|
strerror_r(errno, buf, sizeof(buf));
|
2671
|
2671
|
syslog(LOG_ERR,
|
2672
|
|
- "write failure (%u bytes) to clamd: %s",
|
|
2672
|
+ _("write failure (%u bytes) to clamd: %s"),
|
2673
|
2673
|
len, buf);
|
2674
|
2674
|
#else
|
2675
|
|
- syslog(LOG_ERR, "write failure (%u bytes) to clamd: %s", len, strerror(errno));
|
|
2675
|
+ syslog(LOG_ERR, _("write failure (%u bytes) to clamd: %s"), len, strerror(errno));
|
2676
|
2676
|
#endif
|
2677
|
2677
|
}
|
2678
|
2678
|
checkClamd();
|
...
|
...
|
@@ -2736,7 +2759,7 @@ clamd_recv(int sock, char *buf, size_t len)
|
2736
|
2736
|
return -1;
|
2737
|
2737
|
case 0:
|
2738
|
2738
|
if(use_syslog)
|
2739
|
|
- syslog(LOG_ERR, "No data received from clamd in %d seconds\n", readTimeout);
|
|
2739
|
+ syslog(LOG_ERR, _("No data received from clamd in %d seconds\n"), readTimeout);
|
2740
|
2740
|
return 0;
|
2741
|
2741
|
}
|
2742
|
2742
|
return recv(sock, buf, len, 0);
|
...
|
...
|
@@ -2758,7 +2781,7 @@ updateSigFile(void)
|
2758
|
2758
|
if(stat(sigFilename, &statb) < 0) {
|
2759
|
2759
|
perror(sigFilename);
|
2760
|
2760
|
if(use_syslog)
|
2761
|
|
- syslog(LOG_ERR, "Can't stat %s", sigFilename);
|
|
2761
|
+ syslog(LOG_ERR, _("Can't stat %s"), sigFilename);
|
2762
|
2762
|
return 0;
|
2763
|
2763
|
}
|
2764
|
2764
|
|
...
|
...
|
@@ -2769,7 +2792,7 @@ updateSigFile(void)
|
2769
|
2769
|
if(fd < 0) {
|
2770
|
2770
|
perror(sigFilename);
|
2771
|
2771
|
if(use_syslog)
|
2772
|
|
- syslog(LOG_ERR, "Can't open %s", sigFilename);
|
|
2772
|
+ syslog(LOG_ERR, _("Can't open %s"), sigFilename);
|
2773
|
2773
|
return 0;
|
2774
|
2774
|
}
|
2775
|
2775
|
|
...
|
...
|
@@ -2904,7 +2927,7 @@ connect2clamd(struct privdata *privdata)
|
2904
|
2904
|
if((mkdir(privdata->filename, 0700) < 0) && (errno != EEXIST)) {
|
2905
|
2905
|
perror(privdata->filename);
|
2906
|
2906
|
if(use_syslog)
|
2907
|
|
- syslog(LOG_ERR, "mkdir %s failed", privdata->filename);
|
|
2907
|
+ syslog(LOG_ERR, _("mkdir %s failed"), privdata->filename);
|
2908
|
2908
|
return 0;
|
2909
|
2909
|
}
|
2910
|
2910
|
|
...
|
...
|
@@ -2917,7 +2940,7 @@ connect2clamd(struct privdata *privdata)
|
2917
|
2917
|
#else
|
2918
|
2918
|
if(mktemp(privdata->filename) == NULL) {
|
2919
|
2919
|
if(use_syslog)
|
2920
|
|
- syslog(LOG_ERR, "mktemp %s failed", privdata->filename);
|
|
2920
|
+ syslog(LOG_ERR, _("mktemp %s failed"), privdata->filename);
|
2921
|
2921
|
return 0;
|
2922
|
2922
|
}
|
2923
|
2923
|
privdata->dataSocket = open(privdata->filename, O_CREAT|O_EXCL|O_WRONLY|O_TRUNC, 0600);
|
...
|
...
|
@@ -2927,7 +2950,7 @@ connect2clamd(struct privdata *privdata)
|
2927
|
2927
|
if(privdata->dataSocket < 0) {
|
2928
|
2928
|
perror(privdata->filename);
|
2929
|
2929
|
if(use_syslog)
|
2930
|
|
- syslog(LOG_ERR, "Temporary quarantine file %s creation failed", privdata->filename);
|
|
2930
|
+ syslog(LOG_ERR, _("Temporary quarantine file %s creation failed"), privdata->filename);
|
2931
|
2931
|
return 0;
|
2932
|
2932
|
}
|
2933
|
2933
|
privdata->serverNumber = -1;
|
...
|
...
|
@@ -2992,7 +3015,7 @@ connect2clamd(struct privdata *privdata)
|
2992
|
2992
|
if((privdata->dataSocket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
2993
|
2993
|
perror("socket");
|
2994
|
2994
|
if(use_syslog)
|
2995
|
|
- syslog(LOG_ERR, "failed to create socket");
|
|
2995
|
+ syslog(LOG_ERR, _("failed to create socket"));
|
2996
|
2996
|
return 0;
|
2997
|
2997
|
}
|
2998
|
2998
|
|
...
|
...
|
@@ -3001,7 +3024,7 @@ connect2clamd(struct privdata *privdata)
|
3001
|
3001
|
if(send(privdata->cmdSocket, "STREAM\n", 7, 0) < 7) {
|
3002
|
3002
|
perror("send");
|
3003
|
3003
|
if(use_syslog)
|
3004
|
|
- syslog(LOG_ERR, "send failed to clamd");
|
|
3004
|
+ syslog(LOG_ERR, _("send failed to clamd"));
|
3005
|
3005
|
return 0;
|
3006
|
3006
|
}
|
3007
|
3007
|
|
...
|
...
|
@@ -3011,7 +3034,7 @@ connect2clamd(struct privdata *privdata)
|
3011
|
3011
|
if(nbytes < 0) {
|
3012
|
3012
|
perror("recv");
|
3013
|
3013
|
if(use_syslog)
|
3014
|
|
- syslog(LOG_ERR, "recv failed from clamd getting PORT");
|
|
3014
|
+ syslog(LOG_ERR, _("recv failed from clamd getting PORT"));
|
3015
|
3015
|
return 0;
|
3016
|
3016
|
}
|
3017
|
3017
|
buf[nbytes] = '\0';
|
...
|
...
|
@@ -3021,10 +3044,10 @@ connect2clamd(struct privdata *privdata)
|
3021
|
3021
|
#endif
|
3022
|
3022
|
if(sscanf(buf, "PORT %hu\n", &p) != 1) {
|
3023
|
3023
|
if(use_syslog)
|
3024
|
|
- syslog(LOG_ERR, "Expected port information from clamd, got '%s'",
|
|
3024
|
+ syslog(LOG_ERR, _("Expected port information from clamd, got '%s'"),
|
3025
|
3025
|
buf);
|
3026
|
3026
|
else
|
3027
|
|
- cli_warnmsg("Expected port information from clamd, got '%s'\n",
|
|
3027
|
+ cli_warnmsg(_("Expected port information from clamd, got '%s'\n"),
|
3028
|
3028
|
buf);
|
3029
|
3029
|
return 0;
|
3030
|
3030
|
}
|
...
|
...
|
@@ -3039,7 +3062,7 @@ connect2clamd(struct privdata *privdata)
|
3039
|
3039
|
|
3040
|
3040
|
#ifdef CL_DEBUG
|
3041
|
3041
|
if(debug_level >= 4)
|
3042
|
|
- cli_dbgmsg("Connecting to local port %d\n", p);
|
|
3042
|
+ cli_dbgmsg(_("Connecting to local port %d\n"), p);
|
3043
|
3043
|
#endif
|
3044
|
3044
|
|
3045
|
3045
|
if(connect(privdata->dataSocket, (struct sockaddr *)&reply, sizeof(struct sockaddr_in)) < 0) {
|
...
|
...
|
@@ -3050,10 +3073,10 @@ connect2clamd(struct privdata *privdata)
|
3050
|
3050
|
#ifdef HAVE_STRERROR_R
|
3051
|
3051
|
strerror_r(errno, buf, sizeof(buf));
|
3052
|
3052
|
syslog(LOG_ERR,
|
3053
|
|
- "Failed to connect to port %d given by clamd: %s",
|
|
3053
|
+ _("Failed to connect to port %d given by clamd: %s"),
|
3054
|
3054
|
p, buf);
|
3055
|
3055
|
#else
|
3056
|
|
- syslog(LOG_ERR, "Failed to connect to port %d given by clamd: %s", p, strerror(errno));
|
|
3056
|
+ syslog(LOG_ERR, _("Failed to connect to port %d given by clamd: %s"), p, strerror(errno));
|
3057
|
3057
|
#endif
|
3058
|
3058
|
}
|
3059
|
3059
|
return 0;
|
...
|
...
|
@@ -3120,7 +3143,7 @@ checkClamd(void)
|
3120
|
3120
|
if(fd < 0) {
|
3121
|
3121
|
perror(pidFile);
|
3122
|
3122
|
if(use_syslog)
|
3123
|
|
- syslog(LOG_ERR, "Can't open %s", pidFile);
|
|
3123
|
+ syslog(LOG_ERR, _("Can't open %s"), pidFile);
|
3124
|
3124
|
return;
|
3125
|
3125
|
}
|
3126
|
3126
|
nbytes = read(fd, buf, sizeof(buf) - 1);
|
...
|
...
|
@@ -3132,7 +3155,7 @@ checkClamd(void)
|
3132
|
3132
|
pid = atoi(buf);
|
3133
|
3133
|
if((kill(pid, 0) < 0) && (errno == ESRCH)) {
|
3134
|
3134
|
if(use_syslog)
|
3135
|
|
- syslog(LOG_ERR, "Clamd (pid %d) seems to have died",
|
|
3135
|
+ syslog(LOG_ERR, _("Clamd (pid %d) seems to have died"),
|
3136
|
3136
|
pid);
|
3137
|
3137
|
perror("clamd");
|
3138
|
3138
|
}
|
...
|
...
|
@@ -3158,7 +3181,7 @@ sendtemplate(SMFICTX *ctx, const char *filename, FILE *sendmail, const char *vir
|
3158
|
3158
|
if(fin == NULL) {
|
3159
|
3159
|
perror(filename);
|
3160
|
3160
|
if(use_syslog)
|
3161
|
|
- syslog(LOG_ERR, "Can't open e-mail template file %s",
|
|
3161
|
+ syslog(LOG_ERR, _("Can't open e-mail template file %s"),
|
3162
|
3162
|
filename);
|
3163
|
3163
|
return -1;
|
3164
|
3164
|
}
|
...
|
...
|
@@ -3167,7 +3190,7 @@ sendtemplate(SMFICTX *ctx, const char *filename, FILE *sendmail, const char *vir
|
3167
|
3167
|
/* File disappeared in race condition? */
|
3168
|
3168
|
perror(filename);
|
3169
|
3169
|
if(use_syslog)
|
3170
|
|
- syslog(LOG_ERR, "Can't stat e-mail template file %s",
|
|
3170
|
+ syslog(LOG_ERR, _("Can't stat e-mail template file %s"),
|
3171
|
3171
|
filename);
|
3172
|
3172
|
fclose(fin);
|
3173
|
3173
|
return -1;
|
...
|
...
|
@@ -3176,7 +3199,7 @@ sendtemplate(SMFICTX *ctx, const char *filename, FILE *sendmail, const char *vir
|
3176
|
3176
|
if(buf == NULL) {
|
3177
|
3177
|
fclose(fin);
|
3178
|
3178
|
if(use_syslog)
|
3179
|
|
- syslog(LOG_ERR, "Out of memory");
|
|
3179
|
+ syslog(LOG_ERR, _("Out of memory"));
|
3180
|
3180
|
return -1;
|
3181
|
3181
|
}
|
3182
|
3182
|
fread(buf, sizeof(char), statb.st_size, fin);
|
...
|
...
|
@@ -3203,7 +3226,7 @@ sendtemplate(SMFICTX *ctx, const char *filename, FILE *sendmail, const char *vir
|
3203
|
3203
|
continue;
|
3204
|
3204
|
default:
|
3205
|
3205
|
syslog(LOG_ERR,
|
3206
|
|
- "%s: Unknown clamAV variable \"%c\"\n",
|
|
3206
|
+ _("%s: Unknown clamAV variable \"%c\"\n"),
|
3207
|
3207
|
filename, *ptr);
|
3208
|
3208
|
break;
|
3209
|
3209
|
}
|
...
|
...
|
@@ -3213,7 +3236,7 @@ sendtemplate(SMFICTX *ctx, const char *filename, FILE *sendmail, const char *vir
|
3213
|
3213
|
|
3214
|
3214
|
if(end == NULL) {
|
3215
|
3215
|
syslog(LOG_ERR,
|
3216
|
|
- "%s: Unterminated sendmail variable \"%s\"\n",
|
|
3216
|
+ _("%s: Unterminated sendmail variable \"%s\"\n"),
|
3217
|
3217
|
filename, ptr);
|
3218
|
3218
|
continue;
|
3219
|
3219
|
}
|
...
|
...
|
@@ -3224,7 +3247,7 @@ sendtemplate(SMFICTX *ctx, const char *filename, FILE *sendmail, const char *vir
|
3224
|
3224
|
fputs(ptr, sendmail);
|
3225
|
3225
|
if(use_syslog)
|
3226
|
3226
|
syslog(LOG_ERR,
|
3227
|
|
- "%s: Unknown sendmail variable \"%s\"\n",
|
|
3227
|
+ _("%s: Unknown sendmail variable \"%s\"\n"),
|
3228
|
3228
|
filename, ptr);
|
3229
|
3229
|
} else
|
3230
|
3230
|
fputs(val, sendmail);
|
...
|
...
|
@@ -3273,10 +3296,11 @@ qfile(struct privdata *privdata, const char *virusname)
|
3273
|
3273
|
* of the virus is included in the filename
|
3274
|
3274
|
*/
|
3275
|
3275
|
for(ptr = newname; *ptr; ptr++) {
|
|
3276
|
+#ifdef C_DARWIN
|
|
3277
|
+ *ptr &= '\177';
|
|
3278
|
+#endif
|
3276
|
3279
|
#if defined(MSDOS) || defined(C_CYGWIN) || defined(WIN32)
|
3277
|
3280
|
if(strchr("/*?<>|\"+=,;: ", *ptr))
|
3278
|
|
-#elif defined(C_DARWIN)
|
3279
|
|
- if((*ptr == '/') || (*ptr >= '\200'))
|
3280
|
3281
|
#else
|
3281
|
3282
|
if(*ptr == '/')
|
3282
|
3283
|
#endif
|
...
|
...
|
@@ -3285,7 +3309,7 @@ qfile(struct privdata *privdata, const char *virusname)
|
3285
|
3285
|
if(link(privdata->filename, newname) < 0) {
|
3286
|
3286
|
perror(newname);
|
3287
|
3287
|
if(use_syslog)
|
3288
|
|
- syslog(LOG_WARNING, "Can't rename %s to %s",
|
|
3288
|
+ syslog(LOG_WARNING, _("Can't rename %1$s to %2$s"),
|
3289
|
3289
|
privdata->filename, newname);
|
3290
|
3290
|
free(newname);
|
3291
|
3291
|
return -1;
|
...
|
...
|
@@ -3307,7 +3331,7 @@ setsubject(SMFICTX *ctx, const char *virusname)
|
3307
|
3307
|
/*
|
3308
|
3308
|
* FIXME: doesn't work if there's no subject in the email
|
3309
|
3309
|
*/
|
3310
|
|
- snprintf(subject, sizeof(subject) - 1, "[Virus] %s", virusname);
|
|
3310
|
+ snprintf(subject, sizeof(subject) - 1, _("[Virus] %s"), virusname);
|
3311
|
3311
|
smfi_chgheader(ctx, "Subject", 1, subject);
|
3312
|
3312
|
}
|
3313
|
3313
|
|