2 Authored by Attila Bogar and Jean-Michel Vourgère <jmv_deb@nirgal.com>
4 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
6 diff -Nura mcrypt-2.6.8.orig/src/mcrypt.c mcrypt-2.6.8/src/mcrypt.c
7 --- mcrypt-2.6.8.orig/src/mcrypt.c 2013-01-14 19:15:49.465925072 -0300
8 +++ mcrypt-2.6.8/src/mcrypt.c 2013-01-14 19:28:13.711478000 -0300
11 "$Id: mcrypt.c,v 1.2 2007/11/07 17:10:21 nmav Exp $";
14 +/* Temporary error message can contain one file name and 1k of text */
15 +#define ERRWIDTH ((PATH_MAX)+1024)
16 +char tmperr[ERRWIDTH];
17 unsigned int stream_flag = FALSE;
22 if (stream_flag == FALSE) {
23 if (is_normal_file(file[i]) == FALSE) {
25 + snprintf(tmperr, ERRWIDTH,
27 ("%s: %s is not a regular file. Skipping...\n"),
28 program_name, file[i]);
31 if ((isatty(fileno((FILE *) (stdin))) == 1)
32 && (stream_flag == TRUE) && (force == 0)) { /* not a tty */
34 + snprintf(tmperr, ERRWIDTH,
36 ("%s: Encrypted data will not be read from a terminal.\n"),
40 if ((isatty(fileno((FILE *) (stdout))) == 1)
41 && (stream_flag == TRUE) && (force == 0)) { /* not a tty */
43 + snprintf(tmperr, ERRWIDTH,
45 ("%s: Encrypted data will not be written to a terminal.\n"),
48 strcpy(outfile, einfile);
49 /* if file has already the .nc ignore it */
50 if (strstr(outfile, ".nc") != NULL) {
52 + snprintf(tmperr, ERRWIDTH,
54 ("%s: file %s has the .nc suffix... skipping...\n"),
55 program_name, outfile);
59 if (stream_flag == FALSE) {
60 - sprintf(tmperr, _("File %s was decrypted.\n"), dinfile);
61 + snprintf(tmperr, ERRWIDTH, _("File %s was decrypted.\n"), dinfile);
64 - sprintf(tmperr, _("Stdin was decrypted.\n"));
65 + snprintf(tmperr, ERRWIDTH, _("Stdin was decrypted.\n"));
72 if (stream_flag == FALSE) {
74 + snprintf(tmperr, ERRWIDTH,
76 ("File %s was NOT decrypted successfully.\n"),
81 if (stream_flag == FALSE) {
82 - sprintf(tmperr, _("File %s was encrypted.\n"), einfile);
83 + snprintf(tmperr, ERRWIDTH, _("File %s was encrypted.\n"), einfile);
86 - sprintf(tmperr, _("Stdin was encrypted.\n"));
87 + snprintf(tmperr, ERRWIDTH, _("Stdin was encrypted.\n"));
94 if (stream_flag == FALSE) {
96 + snprintf(tmperr, ERRWIDTH,
98 ("File %s was NOT encrypted successfully.\n"),