[PATCH] fix for new "stat" command with empty cur/new dirs
Dale Woolridge <[email protected]> Fri, 9 Sep 2005 12:18:09 -0400
| Newsgroups | gmane.mail.vmailmgr |
|---|---|
| Message-ID | <[email protected]> |
--maH1Gajj2nflutpK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
The new "stat" command gives an error when one or both of the /cur and
/new dirs is empty. Attached is a patch to fix this, including some
request logging for the command. I realize this pretty much makes it
impossible to get errors back from the "stat" command.
Are there plans to have "stat" provide deep directory stats instead of
just top-maildir results? Would a change like this be acceptable (and
accepted) either as a replacement for "stat", as a parameter to "stat",
or as a new "quota"/other command?
I'm also attaching a couple of patches that I need on freebsd 5.3 to get
vmailmgr-0.97 to compile. The changes should be okay on other platforms,
for the most part.
p.s.
Is vupgrade now supposed to do in-place upgrades of existing 0.96.9
installations?
thanks.
--
-dale
--maH1Gajj2nflutpK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vmailmgr-0.97-stat.dw.patch"
Index: stat.cc
===================================================================
--- stat.cc (revision 332)
+++ stat.cc (working copy)
@@ -103,7 +103,7 @@
{
statdir dir(basename + "/new");
if(!dir)
- return false;
+ return true;
while(dir) {
if(S_ISREG(dir->st_mode)) {
++stats.unseen_new.count;
@@ -118,7 +118,7 @@
{
statdir dir(basename + "/cur");
if(!dir)
- return false;
+ return true;
while(dir) {
if(S_ISREG(dir->st_mode)) {
count_size* stat = &stats.unseen;
@@ -147,6 +147,8 @@
{
mystring user = args[0];
mystring pass = args[1];
+ args[1] = LOG_PASSWORD;
+ logcommand(args);
pwentry* pw;
vpwentry* vpw;
--maH1Gajj2nflutpK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-lib:misc:server.cc"
--- lib/misc/server.cc Sun Sep 4 19:24:42 2005
+++ lib/misc/server.cc Sun Sep 4 19:25:07 2005
@@ -17,6 +17,7 @@
#include <config.h>
#include "server.h"
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include "un.h"
#include "debug.h"
--maH1Gajj2nflutpK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-lib:fdbuf:fdbuf.h"
--- lib/fdbuf/fdbuf.h.orig Mon Feb 2 14:40:11 2004
+++ lib/fdbuf/fdbuf.h Mon Feb 2 14:40:38 2004
@@ -25,6 +25,9 @@
#include <pthread.h>
#endif
+#include <unistd.h>
+#include <sys/types.h>
+
#ifndef FDBUF_SIZE
#define FDBUF_SIZE 4096
#endif
--maH1Gajj2nflutpK
Content-Type: text/plain; charset=us-ascii
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--maH1Gajj2nflutpK--