diff options
author | CHTEKK <CHTEKK@localhost> | 2007-05-01 10:46:35 +0000 |
---|---|---|
committer | CHTEKK <CHTEKK@localhost> | 2007-05-01 10:46:35 +0000 |
commit | abb44053a087a265efd9fdebb08b132a96b326da (patch) | |
tree | ed53bf4d2c4f48d30b9eb86c675fd99d3e7e2261 | |
parent | Update VDA-NG to correctly handle broken maildirsize file, thanks to Tomas Ma... (diff) | |
download | chtekk-abb44053a087a265efd9fdebb08b132a96b326da.tar.gz chtekk-abb44053a087a265efd9fdebb08b132a96b326da.tar.bz2 chtekk-abb44053a087a265efd9fdebb08b132a96b326da.zip |
Fix vstring usage, thanks to Tomas Macek.
svn path=/; revision=45
-rw-r--r-- | vda/postfix-2.4.0-vda-ng.patch | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vda/postfix-2.4.0-vda-ng.patch b/vda/postfix-2.4.0-vda-ng.patch index 553939f..4d7220d 100644 --- a/vda/postfix-2.4.0-vda-ng.patch +++ b/vda/postfix-2.4.0-vda-ng.patch @@ -345,7 +345,7 @@ diff -Nru postfix-2.4.0/src/virtual/mailbox.c postfix-2.4.0-vda/src/virtual/mail * Cleanup. diff -Nru postfix-2.4.0/src/virtual/maildir.c postfix-2.4.0-vda/src/virtual/maildir.c --- postfix-2.4.0/src/virtual/maildir.c 2006-06-26 14:59:19.000000000 +0200 -+++ postfix-2.4.0-vda/src/virtual/maildir.c 2007-04-27 01:20:11.000000000 +0200 ++++ postfix-2.4.0-vda/src/virtual/maildir.c 2007-05-01 12:44:34.000000000 +0200 @@ -63,28 +63,394 @@ #include <mbox_open.h> #include <dsn_util.h> @@ -397,19 +397,19 @@ diff -Nru postfix-2.4.0/src/virtual/maildir.c postfix-2.4.0-vda/src/virtual/mail + long sum = 0, count = 0; + + vstring_sprintf(sizefilename, "%s/%s", dirname, "maildirsize"); -+ sizefile = vstream_fopen(vstring_str(sizefilename), O_RDONLY, 0); -+ if (!sizefile || (stat(vstring_str(sizefilename), &statbuf) < 0) || (statbuf.st_size > SIZEFILE_MAX)) { ++ sizefile = vstream_fopen(STR(sizefilename), O_RDONLY, 0); ++ if (!sizefile || (stat(STR(sizefilename), &statbuf) < 0) || (statbuf.st_size > SIZEFILE_MAX)) { + if (sizefile) { + vstream_fclose(sizefile); -+ unlink(sizefilename); ++ unlink(STR(sizefilename)); + } + + return 0; + } + -+ len = vstream_fread(sizefile, vstring_str(sizebuf), SIZEFILE_MAX); ++ len = vstream_fread(sizefile, STR(sizebuf), SIZEFILE_MAX); + -+ p = vstring_str(sizebuf); ++ p = STR(sizebuf); + *(p + len) = '\0'; + first = 1; + @@ -436,10 +436,10 @@ diff -Nru postfix-2.4.0/src/virtual/maildir.c postfix-2.4.0-vda/src/virtual/mail + else { + if (sizefile) { + vstream_fclose(sizefile); -+ unlink(sizefilename); ++ unlink(STR(sizefilename)); + } + -+ msg_warn("read_maildirsize: invalid line '%s' found in %s, removing maildirsize file", q, sizefilename); ++ msg_warn("read_maildirsize: invalid line '%s' found in %s, removing maildirsize file", q, STR(sizefilename)); + + return 0; + } @@ -573,7 +573,7 @@ diff -Nru postfix-2.4.0/src/virtual/maildir.c postfix-2.4.0-vda/src/virtual/mail + else { + buffer = vstring_alloc(1024); + vstring_sprintf(buffer, "%s/%s", dirname, name); -+ if (stat(vstring_str(buffer), &statbuf) < 0) { ++ if (stat(STR(buffer), &statbuf) < 0) { + vstring_free(buffer); + continue; + } @@ -587,7 +587,7 @@ diff -Nru postfix-2.4.0/src/virtual/maildir.c postfix-2.4.0-vda/src/virtual/mail + else { + buffer = vstring_alloc(1024); + vstring_sprintf(buffer, "%s/%s", dirname, name); -+ if (stat(vstring_str(buffer), &statbuf) < 0) { ++ if (stat(STR(buffer), &statbuf) < 0) { + vstring_free(buffer); + continue; + } @@ -598,7 +598,7 @@ diff -Nru postfix-2.4.0/src/virtual/maildir.c postfix-2.4.0-vda/src/virtual/mail + } + } + else if ((statbuf.st_mode & S_IFDIR) != 0) { -+ sum += check_dir_size(vstring_str(buffer), countptr); ++ sum += check_dir_size(STR(buffer), countptr); + } + vstring_free(buffer); + } |