Re: [qmailadmin] qmailadmin has problems with ezmlm-idx 7.0.2: Patch

2011-08-18 Thread Johannes Weberhofer

I have added a patch for that issue on sourceforge some time ago. It's running 
here on my systems:

http://sourceforge.net/tracker/?func=detailaid=3094082group_id=6691atid=306691

Johannes

Am 18.08.11 10:38, schrieb Robert Schulze:

Hi,

Am 17.08.2011 17:03, schrieb Tom Collins:

if (dbuf) will always be true, since you're referring to the array.


oops, I fixed that.


I
think you want if (*dbuf) (e.g., if the first character of dbuf is not
null). Likewise, your test of strcmp(dir,)==0 would be clearer as
just *dir == '\0'.


I think comparing strings with strcmp ist OK.



Use strcpy instead of sprintf to copy strings like this:
sprintf(dbuf,digest).


thats right, fixed.

A new patch is attached.

with kind regards,
Robert Schulze





--
Johannes Weberhofer
Weberhofer GmbH, Austria, Vienna

!DSPAM:4e4cfc4a32711645020277!



[qmailadmin] qmailadmin has problems with ezmlm-idx 7.0.2: Patch

2011-08-17 Thread Sirko Zidlewitz
My Collegue Robert Schulze r...@bytecamp.net has written a patch
for mailinglist.c, but it is for qmailadmin 1.2.15.
It works for us. Thanks Rob.



--- mailinglist.c.orig  2011-08-17 15:53:26.0 +0200
+++ mailinglist.c   2011-08-17 15:53:32.0 +0200
@@ -665,6 +665,7 @@
  int handles[2],pid,z = 0,subuser_count = 0;   char buf[256];
  char *addr;
+ char dbuf[10]={0};
if ( AdminType!=DOMAIN_ADMIN ) {
 snprintf (StatusMessage, sizeof(StatusMessage), %s,
html_text[142]);
@@ -680,14 +681,21 @@
 close(handles[0]);
 dup2(handles[1],fileno(stdout));
 sprintf(TmpBuf1, %s/ezmlm-list, EZMLMDIR);
+
 if(mod == 1) {
-sprintf(TmpBuf2, %s/%s/mod, RealDir, ActionUser);
+   sprintf(dbuf,mod);
 } else if(mod == 2) {
-sprintf(TmpBuf2, %s/%s/digest, RealDir, ActionUser);
-} else {
-sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
+   sprintf(dbuf,digest);
+}
+
+sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
+
+if(dbuf) {
+   execl(TmpBuf1, ezmlm-list, TmpBuf2, dbuf, NULL);
+}
+else {
+   execl(TmpBuf1, ezmlm-list, TmpBuf2, NULL);
 }
-execl(TmpBuf1, ezmlm-list, TmpBuf2, NULL);
 exit(127);
   } else {
 close(handles[1]);
@@ -799,9 +807,16 @@
   pid=fork();
   if (pid==0) {
 snprintf(subpath, sizeof(subpath), %s/ezmlm-sub, EZMLMDIR);
-snprintf(listpath, sizeof(listpath), %s/%s/%s,
-  RealDir, ActionUser, dir);
-execl(subpath, ezmlm-sub, listpath, email, NULL);
+snprintf(listpath, sizeof(listpath), %s/%s/,
+  RealDir, ActionUser);
+
+if(strcmp(dir,)==0) {
+execl(subpath, ezmlm-sub, listpath, email, NULL);
+}
+else {
+execl(subpath, ezmlm-sub, listpath, dir, email, NULL);
+}
+
 exit(127);
   } else wait(pid);
 @@ -870,6 +885,7 @@
 {
  int pid;
  char *p;
+ char dbuf[10]={0};
if ( AdminType!=DOMAIN_ADMIN ) {
 snprintf (StatusMessage, sizeof(StatusMessage), %s,
html_text[142]);
@@ -889,13 +905,18 @@
   if (pid==0) {
 sprintf(TmpBuf1, %s/ezmlm-unsub, EZMLMDIR);
 if(mod == 1) {
-sprintf(TmpBuf2, %s/%s/mod, RealDir, ActionUser);
+   sprintf(dbuf,mod);
 } else if(mod == 2 ) {
-sprintf(TmpBuf2, %s/%s/digest, RealDir, ActionUser);
-} else {
-sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
+   sprintf(dbuf,digest);
+}
+
+sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
+if(!dbuf) {
+   execl(TmpBuf1, ezmlm-unsub, TmpBuf2, Newu, NULL);
+}
+else {
+   execl(TmpBuf1, ezmlm-unsub, TmpBuf2, dbuf, Newu, NULL);
 }
-execl(TmpBuf1, ezmlm-unsub, TmpBuf2, Newu, NULL);
 exit(127);
   } else wait(pid);


!DSPAM:4e4bc8ec32711531911261!



Re: [qmailadmin] qmailadmin has problems with ezmlm-idx 7.0.2: Patch

2011-08-17 Thread Tom Collins
if (dbuf) will always be true, since you're referring to the array.  I
think you want if (*dbuf) (e.g., if the first character of dbuf is not
null).  Likewise, your test of strcmp(dir,)==0 would be clearer as
just *dir == '\0'.

Use strcpy instead of sprintf to copy strings like this:
sprintf(dbuf,digest).

But then again, why bother -- here's a better solution:

char *dbuf = NULL:
...
dbuf = digest;
...
if (dbuf) {
...
}

Does anyone have suggestions for how to support both versions of ezmlm in
the qmailadmin codebase?  Compile-time check which sets a configuration
macro?

-Tom

Sirko Zidlewitz wrote:
 My Collegue Robert Schulze r...@bytecamp.net has written a patch
 for mailinglist.c, but it is for qmailadmin 1.2.15.
 It works for us. Thanks Rob.



 --- mailinglist.c.orig2011-08-17 15:53:26.0 +0200
 +++ mailinglist.c 2011-08-17 15:53:32.0 +0200
 @@ -665,6 +665,7 @@
   int handles[2],pid,z = 0,subuser_count = 0;   char buf[256];
   char *addr;
 + char dbuf[10]={0};
 if ( AdminType!=DOMAIN_ADMIN ) {
  snprintf (StatusMessage, sizeof(StatusMessage), %s,
 html_text[142]);
 @@ -680,14 +681,21 @@
  close(handles[0]);
  dup2(handles[1],fileno(stdout));
  sprintf(TmpBuf1, %s/ezmlm-list, EZMLMDIR);
 +
  if(mod == 1) {
 -sprintf(TmpBuf2, %s/%s/mod, RealDir, ActionUser);
 + sprintf(dbuf,mod);
  } else if(mod == 2) {
 -sprintf(TmpBuf2, %s/%s/digest, RealDir, ActionUser);
 -} else {
 -sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
 + sprintf(dbuf,digest);
 +}
 +
 +sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
 +
 +if(dbuf) {
 + execl(TmpBuf1, ezmlm-list, TmpBuf2, dbuf, NULL);
 +}
 +else {
 + execl(TmpBuf1, ezmlm-list, TmpBuf2, NULL);
  }
 -execl(TmpBuf1, ezmlm-list, TmpBuf2, NULL);
  exit(127);
} else {
  close(handles[1]);
 @@ -799,9 +807,16 @@
pid=fork();
if (pid==0) {
  snprintf(subpath, sizeof(subpath), %s/ezmlm-sub, EZMLMDIR);
 -snprintf(listpath, sizeof(listpath), %s/%s/%s,
 -  RealDir, ActionUser, dir);
 -execl(subpath, ezmlm-sub, listpath, email, NULL);
 +snprintf(listpath, sizeof(listpath), %s/%s/,
 +  RealDir, ActionUser);
 +
 +if(strcmp(dir,)==0) {
 +execl(subpath, ezmlm-sub, listpath, email, NULL);
 +}
 +else {
 +execl(subpath, ezmlm-sub, listpath, dir, email, NULL);
 +}
 +
  exit(127);
} else wait(pid);
  @@ -870,6 +885,7 @@
  {
   int pid;
   char *p;
 + char dbuf[10]={0};
 if ( AdminType!=DOMAIN_ADMIN ) {
  snprintf (StatusMessage, sizeof(StatusMessage), %s,
 html_text[142]);
 @@ -889,13 +905,18 @@
if (pid==0) {
  sprintf(TmpBuf1, %s/ezmlm-unsub, EZMLMDIR);
  if(mod == 1) {
 -sprintf(TmpBuf2, %s/%s/mod, RealDir, ActionUser);
 + sprintf(dbuf,mod);
  } else if(mod == 2 ) {
 -sprintf(TmpBuf2, %s/%s/digest, RealDir, ActionUser);
 -} else {
 -sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
 + sprintf(dbuf,digest);
 +}
 +
 +sprintf(TmpBuf2, %s/%s/, RealDir, ActionUser);
 +if(!dbuf) {
 +   execl(TmpBuf1, ezmlm-unsub, TmpBuf2, Newu, NULL);
 +}
 +else {
 +   execl(TmpBuf1, ezmlm-unsub, TmpBuf2, dbuf, Newu, NULL);
  }
 -execl(TmpBuf1, ezmlm-unsub, TmpBuf2, Newu, NULL);
  exit(127);
} else wait(pid);


 




-- 
Tom Collins
t...@tomlogic.com


!DSPAM:4e4bd83732711373790421!