df8f43848d
- add the WITH_SPAMFOLDER knob from Alex Dupre's PR; - fix lots of bugs in the new vlist code; - fix a couple of bugs in MySQL's "valias -n" implementation; - actually implement "valias -n" for PostgreSQL; - fix a couple of directory descriptor leaks and other buglets. PR: 117321 (the WITH_SPAMFOLDER knob) Submitted by: ale
37 lines
1.4 KiB
C
37 lines
1.4 KiB
C
diff -urN -x .svn ../../vendor/vpopmail/vlist.c ./vlist.c
|
|
--- ../../vendor/vpopmail/vlist.c 2007-12-25 05:03:25.000000000 +0200
|
|
+++ ./vlist.c 2007-12-25 07:31:17.000000000 +0200
|
|
@@ -44,6 +44,7 @@
|
|
#include <sys/stat.h>
|
|
#include <sys/wait.h>
|
|
#include <dirent.h>
|
|
+#include <limits.h>
|
|
#include "vpopmail.h"
|
|
#include "config.h"
|
|
|
|
@@ -79,7 +80,7 @@
|
|
|
|
void usage( int status, char *Message ) {
|
|
printf( "%s\n", Message );
|
|
- printf( "vlist:\n usage: vlist list_name command \n");
|
|
+ printf( "vlist:\n usage: vlist command1 list_name [command2 [address]]\n");
|
|
printf("\n");
|
|
printf("Commands that affect the entire list\n");
|
|
printf(" vlist count domain \n");
|
|
@@ -222,7 +223,7 @@
|
|
char **Buffer = NULL;
|
|
int I=0;
|
|
|
|
- Buffer = listList( LI, 1, 100 );
|
|
+ Buffer = listList( LI, 1, INT_MAX );
|
|
if( NULL != Buffer ) {
|
|
while( Buffer[I] != NULL ) {
|
|
printf( "%s\n", Buffer[I] );
|
|
@@ -630,6 +631,7 @@
|
|
// Parse the second command
|
|
// Note that the strncmp does not check all of the words. 1 or 2 chars is all that is needed.
|
|
if( command1 > 7 ) {
|
|
+ if( argc < 3 ) usage( 101, "At least four parameters are required\n");
|
|
if( 0 == strncmp( argv[3], "count", 2 )) command2 = 1;
|
|
else if( 0 == strncmp( argv[3], "list", 1 )) command2 = 2;
|
|
else if( 0 == strncmp( argv[3], "add", 2 )) command2 = 3;
|