On Monday, March 10, 2003, at 01:49 PM, Phil @ Kusat wrote:
SOLUTION? Can't I update something in the old Vpopmail domains so that they will be compatible on the "new" qmailadmin?

This patch to vpopmail.c (long overdue) should take care of the problem. I haven't tested it, since I don't have a development server to test it on, and I'm not ready to upgrade vpopmail on my production server. The changes are minor and compile OK.


BTW, is there any reason this code uses "*tmpstr = 0; ++tmpstr;" instead of "*tmpstr++ = 0"?

Also, this code could be only scanning through the entry once, instead of twice. I'm just throwing this out in an attempt to solve a longstanding problem. Phil, please report whether upgrading your vpopmail (and recompiling qmailadmin) solves your problem with using the new qmailadmin on an old domain.

--- vpopmail-5.3.16/vpopmail.c  Mon Jan 27 09:29:15 2003
+++ vpopmail-5.3.16-tc/vpopmail.c       Mon Mar 10 14:37:27 2003
@@ -1404,13 +1404,7 @@
     if (fgets(line,sizeof(line),pw) == NULL) return NULL;

     for (i=0; line[i] != 0; i++) if (line[i] == ':') j++;
-
-#ifdef CLEAR_PASS
-    /* Must count the clear password field */
-    if ( j != 7) return NULL;
-#else
-    if ( j != 6) return NULL;
-#endif
+    if (j < 6) return NULL;

     tmpstr = line;
     pwent.pw_name   = line;
@@ -1431,23 +1425,22 @@
     *tmpstr = 0; ++tmpstr;
     pwent.pw_gid = atoi(tmpstr1);

-
     pwent.pw_gecos  = tmpstr;
     while (*tmpstr!=0 && *tmpstr!=':') ++tmpstr;
     *tmpstr = 0; ++tmpstr;

     pwent.pw_dir    = tmpstr;
     while (*tmpstr!=0 && *tmpstr!=':') ++tmpstr;
-    *tmpstr = 0; ++tmpstr;
+    if (*tmpstr) { *tmpstr = 0; ++tmpstr; }

     pwent.pw_shell  = tmpstr;
     while (*tmpstr!=0 && *tmpstr!=':' && *tmpstr!='\n') ++tmpstr;
-    *tmpstr = 0; ++tmpstr;
+    if (*tmpstr) { *tmpstr = 0; ++tmpstr; }

 #ifdef CLEAR_PASS
     pwent.pw_clear_passwd  = tmpstr;
     while (*tmpstr!=0 && *tmpstr!=':' && *tmpstr!='\n') ++tmpstr;
-    *tmpstr = 0; ++tmpstr;
+    if (*tmpstr) { *tmpstr = 0; ++tmpstr; }
 #endif

return &pwent;


-- Tom Collins [EMAIL PROTECTED]




Reply via email to