On Aug 5, 2004, at 5:13 AM, Mark Richardson wrote:
The problem is this:
After converting vdominfo says that there are "0" users in the domain, the
users are in fact in the database but it appears that the field "cur_users"
in the dir_control table isn't updated by vconvert.

Can you (or someone else) test this patch and report back? It should increment the count just like vadduser does. I did a quick test with a 5-user domain and it worked. It should also help with getting the other fields of dir_control set right (so a domain with 1000's of users hashes properly).

I'm going to add code to properly update dir_control for MySQL->CDB as well. I'll check the changes into CVS and they will be in the next release.

diff -u -r1.2.2.1 vconvert.c
--- vconvert.c  10 Mar 2004 15:18:50 -0000
+++ vconvert.c  18 Aug 2004 05:01:38 -0000
@@ -188,6 +188,8 @@
  int i, colon_count, dir_count;
  int bFoundDomain = 0;
  char assign_file[MAX_BUFF];
+ uid_t uid;
+ gid_t gid;

snprintf(assign_file, sizeof(assign_file), "%s/users/assign", QMAILDIR);
if ( (assign_fs=fopen(assign_file, "r"))==NULL ) {
@@ -227,9 +229,13 @@

+    vdel_dir_control(domain);

-    vget_assign(domain, Dir, sizeof(Dir), NULL, NULL );
+    vget_assign(domain, Dir, sizeof(Dir), &uid, &gid );
+    open_big_dir (domain, uid, gid);
     snprintf(tmpbuf, sizeof(tmpbuf), "%s/vpasswd", Dir);
     fs = fopen(tmpbuf,"r");
     if ( fs == NULL ) return(-1);
@@ -241,8 +247,14 @@
       vauth_setpw(pw, domain);
+      next_big_dir (uid, gid);  /* increment user count */
+    close_big_dir (domain, uid, gid);
 #endif /* USE_SQL */

Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/

Reply via email to