You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(26) |
Oct
(53) |
Nov
(30) |
Dec
(50) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(61) |
Feb
(25) |
Mar
(23) |
Apr
(23) |
May
(9) |
Jun
(25) |
Jul
(6) |
Aug
(6) |
Sep
(5) |
Oct
(8) |
Nov
(18) |
Dec
(16) |
2005 |
Jan
(10) |
Feb
(8) |
Mar
(15) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
(7) |
Aug
|
Sep
(4) |
Oct
|
Nov
(2) |
Dec
(4) |
2006 |
Jan
(7) |
Feb
(8) |
Mar
(4) |
Apr
(10) |
May
(12) |
Jun
(18) |
Jul
(3) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(25) |
Dec
(27) |
2007 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(9) |
May
(42) |
Jun
(3) |
Jul
(3) |
Aug
(7) |
Sep
(18) |
Oct
(12) |
Nov
(6) |
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2009 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Matt B. <vo...@us...> - 2009-01-16 17:21:05
|
Update of /cvsroot/vpopmail/vpopmail In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16911 Modified Files: ChangeLog Log Message: Updated Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.190 retrieving revision 1.191 diff -u -d -r1.190 -r1.191 --- ChangeLog 15 Jan 2009 15:31:23 -0000 1.190 +++ ChangeLog 16 Jan 2009 17:20:59 -0000 1.191 @@ -1,7 +1,7 @@ Numbers in square brackets ([]) are tracker items on SourceForge with patch or info related to the entry. <http://sourceforge.net/projects/vpopmail/> -5.4.27 - unreleased +5.4.27 - Released 16-Jan-2009 Jeremy Kister, Rick Widmer, Tom Collins - Solaris doesn't like setenv |
Update of /cvsroot/vpopmail/vpopmail In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4030 Modified Files: ChangeLog Makefile.am configure configure.in vpopmail.c vpopmail.h Added Files: README.authvchkpw authvchkpw.c backfill.c Log Message: Added authvchkpw module for Courier-IMAP [2507177] Added backfill patch [2507177] Index: configure =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- configure 4 Nov 2007 01:10:00 -0000 1.52 +++ configure 15 Jan 2009 15:31:23 -0000 1.53 @@ -7396,7 +7396,7 @@ { (exit 1); exit 1; }; } fi - auth_libs="-L$libdir $extralibflags -lmysqlclient -lz -lm" + auth_libs="-Xlinker -R -Xlinker $libdir -L$libdir $extralibflags -lmysqlclient -lz -lm" ;; @@ -9462,21 +9462,22 @@ fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. +_am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $ac_file | $ac_file:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| . 2>/dev/null || -echo X$ac_file | +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9513,7 +9514,7 @@ # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ Index: configure.in =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure.in,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- configure.in 4 Nov 2007 01:10:00 -0000 1.48 +++ configure.in 15 Jan 2009 15:31:23 -0000 1.49 @@ -1094,7 +1094,7 @@ AC_MSG_ERROR([Unable to find your MySQL lib dir, specify --enable-libdir.]) fi - auth_libs="-L$libdir $extralibflags -lmysqlclient -lz -lm" + auth_libs="-Xlinker -R -Xlinker $libdir -L$libdir $extralibflags -lmysqlclient -lz -lm" AC_SUBST(auth_libs) ;; --- NEW FILE: README.authvchkpw --- I have tweaked a bit authvchkpw module for vpopmail. It includes most of the function needed to authenticate. To install it you need to apply patch to vpopmail-5.4.26d. It modifies Makefile.am, configure.in, vpopmail.c, vpopmail.h and creates a new file authvchkpw.c. I have tested it on my laptop and found it to work. But I give no warranty. AUTHMODULES in courier-imap needs to have authvchkpw as one of the authentication modules The module does the following reads 5 lines from imaplogin or pop3login. Authenticates the user and if successful executes the imapd or pop3d executable. If the authentication is not successful, the data is passed to the next authmodule in chain. On successful authentication the module adds entry to lastauth and a entry in relay table. Instructions are in INSTALL section below. If you need more help let me know. If more modifications are needed let me know. /* * Courier-IMAP authmodules Protocol * imap\n * login\n * pos...@te...\n * pass\n * newpass\n * argv[0]=/var/indimail/libexec/authlib/authvchkpw * argv[1]=/var/indimail/libexec/authlib/authpam * argv[2]=/var/indimail/bin/imapd * argv[3]=Maildir */ INSTALLATION 1. Extract vpopmail Development tar.gz file vpopmail-5.4.26d.tar.gz wget http://downloads.sourceforge.net/vpopmail/vpopmail-5.4.26d.tar.gz cd /home/local/src gunzip -c vpopmail-5.4.26d.tar.gz |tar xf - 2. patch -p0 authvchkpw-vpopmail-5.4.26d.patch 3. cd vpopmail-5.4.26 su ./configure # with the usual options make make install-strip Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.189 retrieving revision 1.190 diff -u -d -r1.189 -r1.190 --- ChangeLog 6 Dec 2007 01:45:29 -0000 1.189 +++ ChangeLog 15 Jan 2009 15:31:23 -0000 1.190 @@ -12,6 +12,9 @@ - Fix mixed up usage of MYSQL_UPDATE_* and MYSQL_READ_* in vmysql.c:load_connection_info() This may need a tracker number attached. I can't find it. + Manvendra Bhangui + - Added authvchkpw module for Courier-IMAP + - Added backfill patch [2507177] 5.4.26 - Released 3-Nov-2007 Bill Shupp Index: vpopmail.h =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpopmail.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- vpopmail.h 31 Oct 2007 07:55:39 -0000 1.34 +++ vpopmail.h 15 Jan 2009 15:31:23 -0000 1.35 @@ -303,7 +303,6 @@ char *make_user_dir(char *username, char *domain, uid_t uid, gid_t gid); int r_mkdir(char *, uid_t uid, gid_t gid); struct vqpasswd *vgetent(FILE *); -int pw_comp(char *, char *, char *, int); char *default_domain(); void vset_default_domain( char *); void vupdate_rules(int); @@ -361,3 +360,7 @@ extern int allow_onchange; int call_onchange(); #endif + +#ifdef USERS_BIG_DIR +char *backfill(char *, char *, char *, int); +#endif Index: Makefile.am =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/Makefile.am,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Makefile.am 31 Oct 2007 07:55:39 -0000 1.26 +++ Makefile.am 15 Jan 2009 15:31:23 -0000 1.27 @@ -9,7 +9,7 @@ noinst_HEADERS=md5.h vpopmail.h file_lock.h vauth.h vlimits.h maildirquota.h vcdb.h vldap.h vmysql.h voracle.h vpgsql.h vsybase.h vlog.h global.h hmac_md5.h seek.h vutil.h -COMMONSOURCES=vpopmail.c md5.c bigdir.c vauth.c file_lock.c vpalias.c seek.c vlimits.c maildirquota.c vutil.c vlistlib.c +COMMONSOURCES=vpopmail.c md5.c bigdir.c vauth.c file_lock.c vpalias.c seek.c vlimits.c maildirquota.c vutil.c vlistlib.c backfill.c CONFIG_CLEAN_FILES=vauth.c cdb/conf-cc cdb/conf-ld cdb/compile cdb/load @@ -30,7 +30,7 @@ vdeldomain vpasswd vadduser vdeluser vaddaliasdomain vsetuserquota \ vpopbull vdeloldusers vmoduser valias vuserinfo vmkpasswd vipmap \ vdominfo vconvert vkill vmoddomlimits vchangepw dotqmail2valias \ - vpopmaild vlist + vpopmaild vlist authvchkpw vuserinfo_SOURCES = vuserinfo.c maildirquota.c vuserinfo_LDADD = libvpopmail.a @auth_libs@ @@ -38,6 +38,9 @@ vlist_SOURCES = vlist.c vlistlib.c vutil.c vlist_LDADD = libvpopmail.a @auth_libs@ +authvchkpw_SOURCES = authvchkpw.c hmac_md5.c +authvchkpw_LDADD = libvpopmail.a @auth_libs@ + vpopmaild_SOURCES = vpopmaild.c vpopmaild_LDADD = libvpopmail.a @auth_libs@ Index: vpopmail.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpopmail.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- vpopmail.c 31 Oct 2007 07:55:39 -0000 1.58 +++ vpopmail.c 15 Jan 2009 15:31:23 -0000 1.59 @@ -1434,6 +1434,7 @@ pid=vfork(); if ( pid==0){ + umask(022); execl(QMAILNEWU,"qmail-newu", NULL); exit(127); } else { @@ -1764,6 +1765,8 @@ return (-1); } + /* write the information to backfill */ + backfill(user, domain, mypw->pw_dir, 2); dec_dir_control(domain, uid, gid); /* remove the user's directory from the file system @@ -2364,9 +2367,13 @@ user_hash=""; #ifdef USERS_BIG_DIR /* go into a user hash dir if required */ - open_big_dir(domain, uid, gid); - user_hash = next_big_dir(uid, gid); - close_big_dir(domain, uid, gid); + if (!(user_hash = backfill(username, domain, 0, 1))) + { + open_big_dir(domain, uid, gid); + user_hash = next_big_dir(uid, gid); + close_big_dir(domain, uid, gid); + } else + r_mkdir(user_hash, uid, gid); chdir(user_hash); #endif /* check the length of the dir path to make sure it is not too --- NEW FILE: authvchkpw.c --- /* * $Log: authvchkpw.c,v $ * Revision 1.1 2009/01/15 15:31:23 volz0r * Added authvchkpw module for Courier-IMAP [2507177] * Added backfill patch [2507177] * * Revision 2.2 2008-08-24 17:43:44+05:30 Cprogrammer * added code to return error for password changes * * Revision 2.1 2008-08-24 14:44:56+05:30 Cprogrammer * courier-imap authmodule for IndiMail * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * The GNU General Public License does not permit incorporating your program * into proprietary programs. If your program is a subroutine library, you * may consider it more useful to permit linking proprietary applications with * the library. If this is what you want to do, use the GNU Lesser General * Public License instead of this License. But first, please read * <http://www.gnu.org/philosophy/why-not-lgpl.html>. * */ #include "config.h" #include "vpopmail.h" #include <stdio.h> #include <fcntl.h> #include <stdlib.h> #include <signal.h> #include <pwd.h> #include <string.h> #include "md5.h" #include "hmac_md5.h" #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include "vauth.h" #ifndef lint static char sccsid[] = "$Id: authvchkpw.c,v 1.1 2009/01/15 15:31:23 volz0r Exp $"; #endif #ifdef AUTH_SIZE #undef AUTH_SIZE #define AUTH_SIZE 512 #else #define AUTH_SIZE 512 #endif int authlen = AUTH_SIZE; static int exec_local(char **, char *, char *, struct vqpasswd *, char *); static char hextab[] = "0123456789abcdef"; void close_connection() { #ifdef PASSWD_CACHE if (!getenv("PASSWD_CACHE")) vclose(); #else /*- Not PASSWD_CACHE */ vclose(); #endif } int pw_comp(char *testlogin, char *password, char *challenge, char *response) { unsigned char digest[16]; unsigned char digascii[33]; char *crypt_pass; unsigned char h; int j; if(!response || (response && !*response)) { if (!(crypt_pass = crypt((char *) challenge, (char *) password))) { printf("454-%s (#4.3.0)\r\n", strerror(errno)); fflush(stdout); _exit (111); } return(strncmp((const char *) crypt_pass, (const char *) password, (size_t) 14)); } hmac_md5((unsigned char *) challenge, (int) strlen((const char *) challenge), (unsigned char *) password, (int) strlen((const char *) password), digest); digascii[32] = 0; for (j = 0; j < 16; j++) { h = digest[j] >> 4; digascii[2 * j] = hextab[h]; h = digest[j] & 0x0f; digascii[(2 * j) + 1] = hextab[h]; } return (strcmp((const char *) digascii, (const char *) response) && strcmp((const char *) password, (const char *) challenge)); } /* * getEnvConfigStr */ void getEnvConfigStr(char **source, char *envname, char *defaultValue) { if (!(*source = getenv(envname))) *source = defaultValue; return; } int Login_Tasks(pw, user, ServiceType) struct passwd *pw; const char *user; char *ServiceType; { char *domain, *ptr; char fqemail[MAX_BUFF]; #ifdef ENABLE_AUTH_LOGGING #ifdef MIN_LOGIN_INTERVAL time_t min_login_interval, last_time; #endif #ifdef USE_MAILDIRQUOTA mdir_t size_limit, count_limit; #endif #endif if (!pw) return(1); lowerit((char *) user); lowerit(pw->pw_name); if (!(ptr = strchr(user, '@'))) { getEnvConfigStr(&domain, "DEFAULT_DOMAIN", DEFAULT_DOMAIN); lowerit(domain); snprintf(fqemail, MAX_BUFF, "%s@%s", user, domain); } else { domain = ptr + 1; strncpy(fqemail, user, MAX_BUFF); *ptr = 0; } if (access(pw->pw_dir, F_OK)) vmake_maildir(domain, pw->pw_dir); #ifdef POP_AUTH_OPEN_RELAY /*- open the relay to pop3/imap users */ if (!getenv("NORELAY") && (pw->pw_gid & NO_RELAY) == 0) open_smtp_relay(pw->pw_name, domain); #endif #ifdef ENABLE_AUTH_LOGGING #ifdef MIN_LOGIN_INTERVAL last_time = vget_lastauth(pw, domain); #endif if (!(ptr = getenv("TCPERMOTEIP"))) ptr = "0.0.0.0"; vset_lastauth(pw->pw_name, domain, ptr); #ifdef MIN_LOGIN_INTERVAL if(( vget_lastauth(vpw,TheDomain ) - last_time ) < MIN_LOGIN_INTERVAL ) { vchkpw_exit(1); } #endif #endif /*- ENABLE_AUTH_LOGGING */ return(0); } int pipe_exec(char **argv, char *tmpbuf, int len) { int pipe_fd[2]; void (*pstat) (); if ((pstat = signal(SIGPIPE, SIG_IGN)) == SIG_ERR) { fprintf(stderr, "pipe_exec: signal: %s\n", strerror(errno)); return (-1); } if(pipe(pipe_fd) == -1) { fprintf(stderr, "pipe_exec: pipe: %s\n", strerror(errno)); signal(SIGPIPE, pstat); return(-1); } if(dup2(pipe_fd[0], 3) == -1 || dup2(pipe_fd[1], 4) == -1) { fprintf(stderr, "pipe_exec: dup2: %s\n", strerror(errno)); signal(SIGPIPE, pstat); return(-1); } if(pipe_fd[0] != 3 && pipe_fd[0] != 4) close(pipe_fd[0]); if(pipe_fd[1] != 3 && pipe_fd[1] != 4) close(pipe_fd[1]); if(write(4, tmpbuf, len) != len) { fprintf(stderr, "pipe_exec: %s: %s\n", argv[1], strerror(errno)); signal(SIGPIPE, pstat); return(-1); } close(4); signal(SIGPIPE, pstat); execvp(argv[1], argv + 1); fprintf(stderr, "pipe_exec: %s: %s\n", argv[1], strerror(errno)); return(-1); } int main(int argc, char **argv) { char *buf, *tmpbuf, *login, *challenge, *crypt_pass, *prog_name, *service, *service_type; char user[AUTH_SIZE], domain[AUTH_SIZE], Email[MAX_BUFF]; int count, offset; uid_t uid; gid_t gid; struct vqpasswd *pw; char *(indiargs[]) = { VPOPMAILDIR"/sbin/imaplogin", VPOPMAILDIR"/libexec/authlib/authvchkpw", VPOPMAILDIR"/bin/imapd", "Maildir", 0 }; if ((prog_name = strrchr(argv[0], '/'))) prog_name++; else prog_name = argv[0]; if (argc < 3) { fprintf(stderr, "%s: no more modules will be tried\n", prog_name); return(1); } if (!(tmpbuf = calloc(1, (authlen + 1) * sizeof(char)))) { fprintf(stderr, "%s: malloc-%d: %s\n", prog_name, authlen + 1, strerror(errno)); return(1); } /* * Courier-IMAP authmodules Protocol * imap\n * login\n * pos...@te...\n * pass\n * newpass\n * argv[0]=/var/indimail/libexec/authlib/try * argv[1]=/var/indimail/libexec/authlib/authpam * argv[2]=/var/indimail/bin/imapd * argv[3]=Maildir */ for (offset = 0;;) { do { count = read(3, tmpbuf + offset, authlen + 1 - offset); #ifdef ERESTART } while (count == -1 && (errno == EINTR || errno == ERESTART)); #else } while (count == -1 && errno == EINTR); #endif if (count == -1) { fprintf(stderr, "read: %s\n", strerror(errno)); return(1); } else if (!count) break; offset += count; if (offset >= (authlen + 1)) { fprintf(stderr, "%s: auth data too long\n", prog_name); return(2); } } if (!(buf = calloc(1, (offset + 1) * sizeof(char)))) { fprintf(stderr, "%s: malloc-%d: %s\n", prog_name, authlen + 1, strerror(errno)); return(1); } memcpy(buf, tmpbuf, offset); count = 0; service = tmpbuf + count; /*- service */ for (;tmpbuf[count] != '\n' && count < offset;count++); if (count == offset || (count + 1) == offset) { fprintf(stderr, "%s: auth data too short\n", prog_name); return(2); } tmpbuf[count++] = 0; service_type = tmpbuf + count; /* type (login or pass) */ for (;tmpbuf[count] != '\n' && count < offset;count++); if (count == offset || (count + 1) == offset) { fprintf(stderr, "%s: auth data too short\n", prog_name); return(2); } tmpbuf[count++] = 0; login = tmpbuf + count; /*- username */ for (;tmpbuf[count] != '\n' && count < offset;count++); if (count == offset || (count + 1) == offset) { fprintf(stderr, "%s: auth data too short\n", prog_name); return(2); } tmpbuf[count++] = 0; challenge = tmpbuf + count; /*- challenge (plain text) */ for (;tmpbuf[count] != '\n' && count < offset;count++); tmpbuf[count++] = 0; if (!strncmp(service_type, "pass", 5)) { fprintf(stderr, "%s: Password Change not supported\n", prog_name); pipe_exec(argv, buf, offset); return(1); } if (parse_email(login, user, domain, MAX_BUFF)) { fprintf(stderr, "%s: could not parse email [%s]\n", prog_name, login); pipe_exec(argv, buf, offset); return (1); } if (!vget_assign(domain, 0, 0, &uid, &gid)) { fprintf(stderr, "%s: domain %s does not exist\n", prog_name, domain); pipe_exec(argv, buf, offset); return (1); } snprintf(Email, MAX_BUFF, "%s@%s", user, domain); if (vauth_open(0)) { fprintf(stderr, "%s: inquery: %s\n", prog_name, strerror(errno)); pipe_exec(argv, buf, offset); return (1); } pw = vauth_getpw(user, domain); if (!pw) { fprintf(stderr, "%s: inquery: %s\n", prog_name, strerror(errno)); pipe_exec(argv, buf, offset); close_connection(); return (1); } /* * Look at what type of connection we are trying to auth. * And then see if the user is permitted to make this type * of connection */ if (strcmp("webmail", service) == 0) { if (pw->pw_gid & NO_WEBMAIL) { fprintf(stderr, "%s: webmail disabled for this account", prog_name); write(2, "AUTHFAILURE\n", 12); close_connection(); execv(*indiargs, argv); fprintf(stderr, "execv %s: %s", *indiargs, strerror(errno)); return (1); } } else if (strcmp("pop3", service) == 0) { if (pw->pw_gid & NO_POP) { fprintf(stderr, "%s: pop3 disabled for this account", prog_name); write(2, "AUTHFAILURE\n", 12); close_connection(); execv(*indiargs, argv); fprintf(stderr, "execv %s: %s", *indiargs, strerror(errno)); return (1); } } else if (strcmp("imap", service) == 0) { if (pw->pw_gid & NO_IMAP) { fprintf(stderr, "%s: imap disabled for this account", prog_name); write(2, "AUTHFAILURE\n", 12); close_connection(); execv(*indiargs, argv); fprintf(stderr, "execv %s: %s", *indiargs, strerror(errno)); return (1); } } crypt_pass = pw->pw_passwd; if (getenv("DEBUG_LOGIN")) { fprintf(stderr, "%s: service[%s] type [%s] login [%s] challenge [%s] pw_passwd [%s]\n", prog_name, service, service_type, login, challenge, crypt_pass); } if (pw_comp(login, crypt_pass, challenge, 0)) { if (argc == 3) { fprintf(stderr, "%s: no more modules will be tried\n", prog_name); write(2, "AUTHFAILURE\n", 12); close_connection(); execv(*indiargs, indiargs); fprintf(stderr, "execv %s: %s", *indiargs, strerror(errno)); return (1); } close_connection(); pipe_exec(argv, buf, offset); return (1); } exec_local(argv + argc - 2, login, domain, pw, service); return(0); } static int exec_local(char **argv, char *userid, char *TheDomain, struct vqpasswd *pw, char *service) { char Maildir[MAX_BUFF], authenv1[MAX_BUFF], authenv2[MAX_BUFF], authenv3[MAX_BUFF], authenv4[MAX_BUFF], authenv5[MAX_BUFF], TheUser[MAX_BUFF], TmpBuf[MAX_BUFF]; char *ptr, *cptr; int status; #ifdef USE_MAILDIRQUOTA mdir_t size_limit, count_limit; #endif for (cptr = TheUser, ptr = userid;*ptr && *ptr != '@';*cptr++ = *ptr++); *cptr = 0; strncpy(TmpBuf, service, MAX_BUFF); if ((ptr = strrchr(TmpBuf, ':'))) *ptr = 0; status = Login_Tasks(pw, userid, TmpBuf); if (status == 2 && !strncasecmp(service, "imap", 4)) { close_connection(); return(1); } close_connection(); snprintf(Maildir, MAX_BUFF, "%s/Maildir", status == 2 ? "/mail/tmp" : pw->pw_dir); if (access(pw->pw_dir, F_OK) || access(Maildir, F_OK) || chdir(pw->pw_dir)) { fprintf(stderr, "chdir: %s: %s\n", pw->pw_dir, strerror(errno)); return(1); } snprintf(authenv1, MAX_BUFF, "AUTHENTICATED=%s", userid); snprintf(authenv2, MAX_BUFF, "AUTHADDR=%s@%s", TheUser, TheDomain); snprintf(authenv3, MAX_BUFF, "AUTHFULLNAME=%s", pw->pw_gecos); #ifdef USE_MAILDIRQUOTA size_limit = parse_quota(pw->pw_shell, &count_limit); snprintf(authenv4, MAX_BUFF, "MAILDIRQUOTA=%"PRIu64"S,%"PRIu64"C", size_limit, count_limit); #else snprintf(authenv4, MAX_BUFF, "MAILDIRQUOTA=%sS", pw->pw_shell); #endif snprintf(authenv5, MAX_BUFF, "MAILDIR=%s", Maildir); putenv(authenv1); putenv(authenv2); putenv(authenv3); putenv(authenv4); putenv(authenv5); close_connection(); execv(argv[0], argv); return(1); } void getversion_authvchkpw_c() { printf("%s\n", sccsid); } --- NEW FILE: backfill.c --- /* * $Log: backfill.c,v $ * Revision 1.1 2009/01/15 15:31:23 volz0r * Added authvchkpw module for Courier-IMAP [2507177] * Added backfill patch [2507177] * * Revision 2.1 2009-01-12 10:38:56+05:30 Cprogrammer * function to backfill empty slots in dir_control * */ #include <string.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include "vpopmail.h" #include "vauth.h" /* * Generic remove a line from a file utility * input: template to search for * file to search inside * * output: less than zero on failure * 0 if successful * 1 if match found */ int remove_line(char *template, char *filename, mode_t mode, int once_only) { int found; char bak_file[MAX_BUFF], tmpbuf[MAX_BUFF]; struct stat statbuf; char *ptr; FILE *fs1, *fs2; int fd; #ifdef FILE_LOCKING int lockfd; #endif if (stat(filename, &statbuf)) { fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return (-1); } #ifdef FILE_LOCKING snprintf(lockfile, sizeof(lockfile), "%s.lock", filename); if ((lockfd = open(lockfile, O_WRONLY | O_CREAT, S_IRUSR|S_IWUSR)) < 0) { fprintf(stderr, "could not open lock file %s: %s\n", lockfile, strerror(errno)); return(-1); } if (get_write_lock(lockfd) < 0 ) return(-1); #endif /*- format a new string */ snprintf(bak_file, MAX_BUFF, "%s.bak", filename); if (rename(filename, bak_file)) { fprintf(stderr, "rename %s->%s: %s\n", filename, bak_file, strerror(errno)); #ifdef FILE_LOCKING unlock_lock(lockfd, 0, SEEK_SET, 0); close(lockfd); #endif return(-1); } /*- open the file and check for error */ if (!(fs1 = fopen(filename, "w+"))) { rename(bak_file, filename); #ifdef FILE_LOCKING unlock_lock(lockfd, 0, SEEK_SET, 0); close(lockfd); #endif fprintf(stderr, "fopen(%s, w+: %s\n", filename, strerror(errno)); return (-1); } fd = fileno(fs1); if (fchmod(fd, mode) || fchown(fd, statbuf.st_uid, statbuf.st_gid)) { rename(bak_file, filename); #ifdef FILE_LOCKING unlock_lock(lockfd, 0, SEEK_SET, 0); close(lockfd); #endif fprintf(stderr, "chmod(%s, %d, %d, %o): %s\n", filename, statbuf.st_uid, statbuf.st_gid, mode, strerror(errno)); return (-1); } /*- open in read mode and check for error */ if (!(fs2 = fopen(bak_file, "r+"))) { rename(bak_file, filename); #ifdef FILE_LOCKING unlock_lock(lockfd, 0, SEEK_SET, 0); close(lockfd); #endif fprintf(stderr, "fopen(%s, r+): %s\n", filename, strerror(errno)); fclose(fs1); return (-1); } /*- pound away on the files run the search algorythm */ for (found = 0;;) { if (!fgets(tmpbuf, MAX_BUFF, fs2)) break; if ((ptr = strchr(tmpbuf, '\n')) != NULL) *ptr = 0; if (once_only & found) { fprintf(fs1, "%s\n", tmpbuf); continue; } if (strncmp(template, tmpbuf, strlen(template))) fprintf(fs1, "%s\n", tmpbuf); else found++; } fclose(fs1); fclose(fs2); unlink(bak_file); #ifdef FILE_LOCKING unlock_lock(lockfd, 0, SEEK_SET, 0); close(lockfd); #endif /* * return 0 = everything went okay, but we didn't find it * 1 = everything went okay and we found a match */ return (found); } char * backfill(char *username, char *domain, char *path, int operation) { vdir_type vdir; char *ptr = (char *) 0; char filename[MAX_BUFF]; static char tmpbuf[MAX_BUFF]; int count, len; #ifdef FILE_LOCKING char lockfile[MAX_BUFF]; int lockfd; #endif uid_t uid; gid_t gid; FILE *fp; if (!domain || !*domain) return ((char *) 0); if (!(ptr = vget_assign(domain, NULL, 0, &uid, &gid))) { fprintf(stderr, "%s: No such domain\n", domain); return((char *) 0); } snprintf(filename, MAX_BUFF, "%s/.dir_control_free", ptr); if (operation == 1) /*- Delete */ { if (!(fp = fopen(filename, "r"))) return ((char *) 0); for (count = 1;;count++) { if (!fgets(tmpbuf, MAX_BUFF - 2, fp)) { fclose(fp); return ((char *) 0); } if (tmpbuf[(len = strlen(tmpbuf)) - 1] != '\n') { fprintf(stderr, "Line No %d in %s Exceeds %d chars\n", count, filename, MAX_BUFF - 2); fclose(fp); return ((char *) 0); } if ((ptr = strchr(tmpbuf, '#'))) *ptr = '\0'; for (ptr = tmpbuf; *ptr && isspace((int) *ptr); ptr++); if (!*ptr) continue; tmpbuf[len - 1] = 0; break; } fclose(fp); if (remove_line(ptr, filename, VPOPMAIL_QMAIL_MODE, 1) == 1) { vread_dir_control(&vdir, domain, uid, gid); if (vdir.cur_users) ++vdir.cur_users; vwrite_dir_control(&vdir, domain, uid, gid); return (ptr); } } else if (operation == 2) /*- add */ { (void) strncpy(tmpbuf, path, MAX_BUFF); if ((ptr = strstr(tmpbuf, username))) { if (ptr != tmpbuf) ptr--; if (*ptr == '/') *ptr = 0; } if ((ptr = strstr(tmpbuf, domain))) { ptr += strlen(domain); if (*ptr == '/') ptr++; if (ptr && *ptr) { #ifdef FILE_LOCKING snprintf(lockfile, sizeof(lockfile), "%s.lock", filename); if ((lockfd = open(lockfile, O_WRONLY | O_CREAT, S_IRUSR|S_IWUSR)) < 0) { fprintf(stderr, "could not open lock file %s: %s\n", lockfile, strerror(errno)); return((char *) 0); } if (get_write_lock(lockfd) < 0 ) return((char *) 0); #endif if (!(fp = fopen(filename, "a"))) { #ifdef FILE_LOCKING unlock_lock(lockfd, 0, SEEK_SET, 0); close(lockfd); #endif return((char *) 0); } fprintf(fp, "%s\n", ptr); fclose(fp); #ifdef FILE_LOCKING unlock_lock(lockfd, 0, SEEK_SET, 0); close(lockfd); #endif return(ptr); } } } return((char *) 0); } |
From: Matt B. <vo...@us...> - 2009-01-14 19:37:18
|
Update of /cvsroot/vpopmail/vpopmail In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10200 Modified Files: vdominfo.c Log Message: Updated to use -r flag Index: vdominfo.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vdominfo.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- vdominfo.c 22 May 2007 03:59:00 -0000 1.15 +++ vdominfo.c 14 Jan 2009 19:37:09 -0000 1.16 @@ -38,6 +38,7 @@ int DisplayDir; int DisplayAll; int DisplayTotalUsers; +int DisplayRealDomain; void usage(); void get_options(int argc, char **argv); @@ -92,11 +93,12 @@ DisplayDir = 0; DisplayTotalUsers = 0; DisplayAll = 1; + DisplayRealDomain = 0; memset(Domain, 0, sizeof(Domain)); errflag = 0; - while( !errflag && (c=getopt(argc,argv,"vanugdt")) != -1 ) { + while( !errflag && (c=getopt(argc,argv,"vanugdtr")) != -1 ) { switch(c) { case 'v': printf("version: %s\n", VERSION); @@ -124,6 +126,10 @@ case 'a': DisplayAll = 1; break; + case 'r': + DisplayRealDomain = 1; + DisplayAll = 0; + break; default: errflag = 1; break; @@ -169,6 +175,8 @@ printf("%lu\n", vdir.cur_users); close_big_dir(realdomain,uid,gid); } + + if ( DisplayRealDomain ) printf("%s\n", realdomain); } } |
From: Ken J. <kb...@us...> - 2008-10-29 21:16:29
|
Update of /cvsroot/vpopmail/vpopmail In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22856 Modified Files: vmysql.c Log Message: sf bug tracker 1829653 Index: vmysql.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vmysql.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- vmysql.c 6 Dec 2007 01:45:29 -0000 1.36 +++ vmysql.c 29 Oct 2008 21:16:21 -0000 1.37 @@ -316,11 +316,11 @@ mysql_init(&mysql_read_getall); if (!(mysql_real_connect(&mysql_read_getall, MYSQL_READ_SERVER, MYSQL_READ_USER, MYSQL_READ_PASSWD, MYSQL_READ_DATABASE, - MYSQL_READ_PORT, NULL, 0))) { + MYSQL_READ_PORT, MYSQL_READ_SOCKET, 0))) { /* we could not connect, at least try the update server */ if (!(mysql_real_connect(&mysql_read_getall, MYSQL_UPDATE_SERVER, MYSQL_UPDATE_USER, MYSQL_UPDATE_PASSWD, MYSQL_UPDATE_DATABASE, - MYSQL_UPDATE_PORT, NULL, 0))) { + MYSQL_UPDATE_PORT, MYSQL_UPDATE_SOCKET, 0))) { verrori = VA_NO_AUTH_CONNECTION; return(-1); } |
From: BuySell <ne...@pb...> - 2008-03-05 01:32:35
|
Dear All, I am running vpopmail 5.4-17, I have domain mycurrentdomain.com, now we have new domain called mynewdomain.com, how to copy all email accounts of mycurrentdomain.com to mynewdomain.com? please advise Thanks & Regards Winanjaya |
From: Rick W. <rw...@us...> - 2007-12-06 01:45:27
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17486 Modified Files: ChangeLog TODO vmysql.c Log Message: Mixup between MYSQL_READ and MYSQL_UPDATE [?] Index: vmysql.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vmysql.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- vmysql.c 17 Aug 2007 22:49:23 -0000 1.35 +++ vmysql.c 6 Dec 2007 01:45:29 -0000 1.36 @@ -167,12 +167,12 @@ MYSQL_UPDATE_SERVER = strtok(conf_update, delimiters); if (MYSQL_UPDATE_SERVER == NULL) return VA_PARSE_ERROR06; - MYSQL_READ_SOCKET = strtok(NULL, delimiters); - if (MYSQL_READ_SOCKET == NULL) return VA_PARSE_ERROR; + MYSQL_UPDATE_SOCKET = strtok(NULL, delimiters); + if (MYSQL_UPDATE_SOCKET == NULL) return VA_PARSE_ERROR; - if (MYSQL_READ_SOCKET[0] != '/') { - MYSQL_READ_PORT = atoi(MYSQL_READ_SOCKET); - MYSQL_READ_SOCKET = NULL; + if (MYSQL_UPDATE_SOCKET[0] != '/') { + MYSQL_UPDATE_PORT = atoi(MYSQL_UPDATE_SOCKET); + MYSQL_UPDATE_SOCKET = NULL; } MYSQL_UPDATE_USER = strtok(NULL, delimiters); Index: TODO =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/TODO,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- TODO 28 Oct 2007 08:59:40 -0000 1.13 +++ TODO 6 Dec 2007 01:45:29 -0000 1.14 @@ -41,3 +41,8 @@ have a maildirquota.c file of its own. SHA or MD5 checksums for the tarball. + +Version function that returns version number and summary of ./configure options. +Suggested by Tren Blackburn + + Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.188 retrieving revision 1.189 diff -u -d -r1.188 -r1.189 --- ChangeLog 18 Nov 2007 05:15:19 -0000 1.188 +++ ChangeLog 6 Dec 2007 01:45:29 -0000 1.189 @@ -8,6 +8,10 @@ Michael Johnson, Steve Cole, dhaval, Rick Widmer - Another attempt at maildirquota + Harmut Wernisch, Tom Collins + - Fix mixed up usage of MYSQL_UPDATE_* and MYSQL_READ_* in vmysql.c:load_connection_info() + This may need a tracker number attached. I can't find it. + 5.4.26 - Released 3-Nov-2007 Bill Shupp |
From: Rick W. <rw...@us...> - 2007-11-18 05:15:20
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10939 Modified Files: ChangeLog vdelivermail.c Log Message: Tom's fix for setenf in vdelivermail Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.187 retrieving revision 1.188 diff -u -d -r1.187 -r1.188 --- ChangeLog 4 Nov 2007 01:10:00 -0000 1.187 +++ ChangeLog 18 Nov 2007 05:15:19 -0000 1.188 @@ -2,7 +2,11 @@ or info related to the entry. <http://sourceforge.net/projects/vpopmail/> 5.4.27 - unreleased + Jeremy Kister, Rick Widmer, Tom Collins + - Solaris doesn't like setenv + Michael Johnson, Steve Cole, dhaval, Rick Widmer + - Another attempt at maildirquota 5.4.26 - Released 3-Nov-2007 Index: vdelivermail.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vdelivermail.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- vdelivermail.c 17 Nov 2007 09:07:27 -0000 1.20 +++ vdelivermail.c 18 Nov 2007 05:15:19 -0000 1.21 @@ -901,7 +901,6 @@ int child; char *(args[4]); int wstat; - char envbuf[MAX_ENV_BUFF]; while ((*prog == ' ') || (*prog == '|')) ++prog; @@ -912,8 +911,7 @@ vexit(EXIT_DEFER); case 0: - snprintf( envbuf, sizeof(envbuf), "%s=%s", "SHELL", "/bin/sh"); - putenv(envbuf); + putenv("SHELL=/bin/sh"); args[0] = "/bin/sh"; args[1] = "-c"; args[2] = prog; args[3] = 0; sig_catch(SIGPIPE,SIG_DFL); execv(*args,args); |
From: Rick W. <rw...@us...> - 2007-11-17 09:07:24
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1991 Modified Files: maildirquota.c vdelivermail.c Log Message: use putenv instead of setenv in vdelivermail for portability Index: vdelivermail.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vdelivermail.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- vdelivermail.c 17 Nov 2007 08:36:03 -0000 1.19 +++ vdelivermail.c 17 Nov 2007 09:07:27 -0000 1.20 @@ -895,9 +895,13 @@ */ void run_command(char *prog) { + +#define MAX_ENV_BUFF 100 + int child; char *(args[4]); int wstat; + char envbuf[MAX_ENV_BUFF]; while ((*prog == ' ') || (*prog == '|')) ++prog; @@ -907,7 +911,9 @@ printf("Unable to fork: %d.", errno); vexit(EXIT_DEFER); case 0: - putenv("SHELL", "/bin/sh", 1); + + snprintf( envbuf, sizeof(envbuf), "%s=%s", "SHELL", "/bin/sh"); + putenv(envbuf); args[0] = "/bin/sh"; args[1] = "-c"; args[2] = prog; args[3] = 0; sig_catch(SIGPIPE,SIG_DFL); execv(*args,args); Index: maildirquota.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/maildirquota.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- maildirquota.c 16 Nov 2007 13:02:01 -0000 1.18 +++ maildirquota.c 17 Nov 2007 09:07:27 -0000 1.19 @@ -38,16 +38,16 @@ /* private functions - no name clashes with courier */ static char *makenewmaildirsizename(const char *, int *); -static int countcurnew(const char *dir, time_t *maxtime, off_t *sizep, int *cntp) -static int countsubdir(const char *dir, const char *subdir, time_t *maxtime, -static int statcurnew(const char *dir, time_t *maxtimestamp) -static int statsubdir(const char *dir, const char *subdir, time_t *maxtime) -static int doaddquota(const char *dir, int maildirsize_fd, -static int docheckquota(const char *dir, int *maildirsize_fdptr, - const char *quota_type, long xtra_size, int xtra_cnt, int *percentage); -static int docount(const char *dir, time_t *dirstamp, off_t *sizep, int *cntp) -static int maildir_checkquota(const char *dir, int *maildirsize_fdptr, - const char *quota_type, long xtra_size, int xtra_cnt); +static int countcurnew(const char *dir, time_t *maxtime, off_t *sizep, int *cntp); +static int countsubdir(const char *dir, const char *subdir, time_t *maxtime, off_t *sizep, int *cntp); +static int statcurnew(const char *dir, time_t *maxtimestamp); +static int statsubdir(const char *dir, const char *subdir, time_t *maxtime); +static int doaddquota(const char *dir, int maildirsize_fd, const char *quota_type, + long maildirsize_size, int maildirsize_cnt, int isnew); +static int docheckquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, + long xtra_size, int xtra_cnt, int *percentage); +static int docount(const char *dir, time_t *dirstamp, off_t *sizep, int *cntp); +static int maildir_checkquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, long xtra_size, int xtra_cnt); /* moved into maildirquota.h as non-static static int maildir_addquota(const char *dir, int maildirsize_fd, const char *quota_type, long maildirsize_size, int maildirsize_cnt); |
From: Rick W. <rw...@us...> - 2007-11-17 08:36:02
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22287 Modified Files: vdelivermail.c Log Message: use putenv instead of setenv in vdelivermail for portability Index: vdelivermail.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vdelivermail.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- vdelivermail.c 22 May 2007 03:59:00 -0000 1.18 +++ vdelivermail.c 17 Nov 2007 08:36:03 -0000 1.19 @@ -907,7 +907,7 @@ printf("Unable to fork: %d.", errno); vexit(EXIT_DEFER); case 0: - setenv("SHELL", "/bin/sh", 1); + putenv("SHELL", "/bin/sh", 1); args[0] = "/bin/sh"; args[1] = "-c"; args[2] = prog; args[3] = 0; sig_catch(SIGPIPE,SIG_DFL); execv(*args,args); |
From: Rick W. <rw...@us...> - 2007-11-16 13:02:00
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13784 Modified Files: maildirquota.c Log Message: possible fix to maildirquota Index: maildirquota.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/maildirquota.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- maildirquota.c 1 Oct 2007 06:59:55 -0000 1.17 +++ maildirquota.c 16 Nov 2007 13:02:01 -0000 1.18 @@ -38,22 +38,20 @@ /* private functions - no name clashes with courier */ static char *makenewmaildirsizename(const char *, int *); -static int countcurnew(const char *, time_t *, off_t *, int *); -static int countsubdir(const char *, const char *, - time_t *, off_t *, int *); -static int statcurnew(const char *, time_t *); -static int statsubdir(const char *, const char *, time_t *); -static int doaddquota(const char *, int, const char *, long, int, int); +static int countcurnew(const char *dir, time_t *maxtime, off_t *sizep, int *cntp) +static int countsubdir(const char *dir, const char *subdir, time_t *maxtime, +static int statcurnew(const char *dir, time_t *maxtimestamp) +static int statsubdir(const char *dir, const char *subdir, time_t *maxtime) +static int doaddquota(const char *dir, int maildirsize_fd, static int docheckquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, long xtra_size, int xtra_cnt, int *percentage); -static int docount(const char *, time_t *, off_t *, int *); +static int docount(const char *dir, time_t *dirstamp, off_t *sizep, int *cntp) static int maildir_checkquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, long xtra_size, int xtra_cnt); -/* +/* moved into maildirquota.h as non-static static int maildir_addquota(const char *dir, int maildirsize_fd, const char *quota_type, long maildirsize_size, int maildirsize_cnt); */ - static int maildir_safeopen(const char *path, int mode, int perm); static char *str_pid_t(pid_t t, char *arg); static char *str_time_t(time_t t, char *arg); @@ -99,6 +97,9 @@ maxsize = limits.diskquota * 1024 * 1024; maxcnt = limits.maxmsgcount; + /* only check the quota if one is set */ + if(( maxsize==0 ) && (maxcnt==0)) return 0; + if (vget_assign (domain, domdir, sizeof(domdir), NULL, NULL) == NULL) return -1; @@ -256,14 +257,13 @@ int user_over_maildirquota( const char *dir, const char *q) { struct stat stat_buf; -int quotafd; -int ret_value; +int quotafd = -1; +int ret_value = 0; - if (fstat(0, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode) && - stat_buf.st_size > 0 && *q) - { - if (maildir_checkquota(dir, "afd, q, stat_buf.st_size, 1) - && errno != EAGAIN) + // stat file is regular file size > 0 what is q? + if (fstat(0, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode) && stat_buf.st_size > 0 && *q) + { // check the quota, and not again error + if (maildir_checkquota(dir, "afd, q, stat_buf.st_size, 1) && errno != EAGAIN) { if (quotafd >= 0) close(quotafd); ret_value = 1; @@ -463,7 +463,7 @@ char *checkfolder=(char *)malloc(strlen(dir)+sizeof("/maildirfolder")); char *newmaildirsizename; struct stat stat_buf; -int maildirsize_fd; +int maildirsize_fd = -1; off_t maildirsize_size; int maildirsize_cnt; unsigned maildirsize_nlines; @@ -507,6 +507,8 @@ return (n); } + /* rebuild the maildirsizefile */ + maxtime=0; maildirsize_size=0; maildirsize_cnt=0; @@ -553,10 +555,10 @@ if (doaddquota(dir, maildirsize_fd, quota_type, maildirsize_size, maildirsize_cnt, 1)) { - free(newmaildirsizename); - unlink(newmaildirsizename); close(maildirsize_fd); + unlink(newmaildirsizename); *maildirsize_fdptr= -1; + free(newmaildirsizename); free(checkfolder); return (-1); } @@ -565,7 +567,6 @@ if (rename(newmaildirsizename, checkfolder)) { - free(checkfolder); unlink(newmaildirsizename); close(maildirsize_fd); *maildirsize_fdptr= -1; @@ -812,8 +813,7 @@ return (n); } -static int countcurnew(const char *dir, time_t *maxtime, - off_t *sizep, int *cntp) +static int countcurnew(const char *dir, time_t *maxtime, off_t *sizep, int *cntp) { char *p=(char *)malloc(strlen(dir)+5); int n; @@ -830,8 +830,7 @@ return (n); } -static int countsubdir(const char *dir, const char *subdir, time_t *maxtime, - off_t *sizep, int *cntp) +static int countsubdir(const char *dir, const char *subdir, time_t *maxtime, off_t *sizep, int *cntp) { char *p; int n; @@ -848,8 +847,7 @@ return (n); } -static int docount(const char *dir, time_t *dirstamp, - off_t *sizep, int *cntp) +static int docount(const char *dir, time_t *dirstamp, off_t *sizep, int *cntp) { struct stat stat_buf; char *p; |
From: Rick W. <rw...@us...> - 2007-11-04 01:09:59
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24352 Modified Files: ChangeLog configure configure.in Log Message: start of 5.4.26 release Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.186 retrieving revision 1.187 diff -u -d -r1.186 -r1.187 --- ChangeLog 4 Nov 2007 01:01:13 -0000 1.186 +++ ChangeLog 4 Nov 2007 01:10:00 -0000 1.187 @@ -1,6 +1,10 @@ Numbers in square brackets ([]) are tracker items on SourceForge with patch or info related to the entry. <http://sourceforge.net/projects/vpopmail/> +5.4.27 - unreleased + + + 5.4.26 - Released 3-Nov-2007 Bill Shupp - vpopmaild fix: find_domain should not list 'page 0' when a domain is not Index: configure =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- configure 31 Oct 2007 07:55:39 -0000 1.51 +++ configure 4 Nov 2007 01:10:00 -0000 1.52 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for vpopmail 5.4.26. +# Generated by GNU Autoconf 2.61 for vpopmail 5.4.27. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -572,8 +572,8 @@ # Identity of this package. PACKAGE_NAME='vpopmail' PACKAGE_TARNAME='vpopmail' -PACKAGE_VERSION='5.4.26' -PACKAGE_STRING='vpopmail 5.4.26' +PACKAGE_VERSION='5.4.27' +PACKAGE_STRING='vpopmail 5.4.27' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -1222,7 +1222,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vpopmail 5.4.26 to adapt to many kinds of systems. +\`configure' configures vpopmail 5.4.27 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1292,7 +1292,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vpopmail 5.4.26:";; + short | recursive ) echo "Configuration of vpopmail 5.4.27:";; esac cat <<\_ACEOF @@ -1416,7 +1416,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vpopmail configure 5.4.26 +vpopmail configure 5.4.27 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1430,7 +1430,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vpopmail $as_me 5.4.26, which was +It was created by vpopmail $as_me 5.4.27, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2126,7 +2126,7 @@ # Define the identity of the package. PACKAGE='vpopmail' - VERSION='5.4.26' + VERSION='5.4.27' cat >>confdefs.h <<_ACEOF @@ -8732,7 +8732,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vpopmail $as_me 5.4.26, which was +This file was extended by vpopmail $as_me 5.4.27, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8785,7 +8785,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -vpopmail config.status 5.4.26 +vpopmail config.status 5.4.27 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Index: configure.in =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure.in,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- configure.in 19 Oct 2007 07:32:26 -0000 1.47 +++ configure.in 4 Nov 2007 01:10:00 -0000 1.48 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.52]) -AC_INIT(vpopmail,5.4.26) +AC_INIT(vpopmail,5.4.27) PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION |
From: Rick W. <rw...@us...> - 2007-11-04 01:01:17
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21262 Modified Files: ChangeLog Log Message: set release date for 5.4.26 Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.185 retrieving revision 1.186 diff -u -d -r1.185 -r1.186 --- ChangeLog 31 Oct 2007 07:55:39 -0000 1.185 +++ ChangeLog 4 Nov 2007 01:01:13 -0000 1.186 @@ -1,7 +1,7 @@ Numbers in square brackets ([]) are tracker items on SourceForge with patch or info related to the entry. <http://sourceforge.net/projects/vpopmail/> -5.4.26 - unreleased +5.4.26 - Released 3-Nov-2007 Bill Shupp - vpopmaild fix: find_domain should not list 'page 0' when a domain is not found. Instead, return "." only. Also indicate in help that per_page is |
From: Bill S. <sh...@us...> - 2007-10-29 05:21:18
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12938 Modified Files: vpalias.c Log Message: woops, left some debugging messages in valias_remove(). Index: vpalias.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpalias.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- vpalias.c 29 Oct 2007 05:12:48 -0000 1.16 +++ vpalias.c 29 Oct 2007 05:21:15 -0000 1.17 @@ -193,9 +193,6 @@ DirNew = strcat(strcpy(malloc(8 + sizeof(Dir) + 4), Dir), ".new"); - fprintf(stderr, "Dir: %s\n", Dir); - fprintf(stderr, "DirNew: %s\n", DirNew); - if ( (fr = fopen(Dir, "r")) == NULL ) { free(DirNew); return(-1); @@ -204,7 +201,6 @@ free(DirNew); return(-1); } - fprintf(stderr, "DirNew: %s\n", DirNew); chmod(Dir,0600); chown(Dir,uid,gid); |
From: Bill S. <sh...@us...> - 2007-10-29 05:12:49
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9884 Modified Files: ChangeLog vpalias.c Log Message: get valias_remove() working for cdb module Index: vpalias.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpalias.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- vpalias.c 22 May 2007 03:59:01 -0000 1.15 +++ vpalias.c 29 Oct 2007 05:12:48 -0000 1.16 @@ -162,8 +162,73 @@ int valias_remove( char *alias, char *domain, char *alias_line) { - fprintf (stderr, "Error: valias_remove() not implemented for non-SQL backends.\n"); - return -1; + int i; + char *tmpstr; + char Dir[156]; + char *p; + char LineBuf[512]; + char *DirNew; + uid_t uid; + gid_t gid; + FILE *fr, *fw; + + if ( alias == NULL ) return(VA_NULL_POINTER); + if ( domain == NULL ) return(VA_NULL_POINTER); + if ( alias_line == NULL ) return(VA_NULL_POINTER); + if ( strlen(alias) > MAX_PW_NAME ) return(VA_USER_NAME_TOO_LONG); + if ( strlen(domain) > MAX_PW_DOMAIN ) return(VA_DOMAIN_NAME_TOO_LONG); + if ( strlen(alias_line) >= MAX_ALIAS_LINE ) return(VA_ALIAS_LINE_TOO_LONG); + + if ((tmpstr = vget_assign(domain, Dir, sizeof(Dir), &uid, &gid )) == NULL) { + printf("invalid domain, not in qmail assign file\n"); + return(-1); + } + + // create dotqmail filename, converting '.' to ':' as we go + strncat(Dir, "/.qmail-", sizeof(Dir)-strlen(Dir)-1); + i = strlen(Dir); + for (p = alias; (i < (int)sizeof(Dir) - 1) && (*p != '\0'); p++) + Dir[i++] = (*p == '.' ? ':' : *p); + Dir[i] = '\0'; + + DirNew = strcat(strcpy(malloc(8 + sizeof(Dir) + 4), Dir), ".new"); + + fprintf(stderr, "Dir: %s\n", Dir); + fprintf(stderr, "DirNew: %s\n", DirNew); + + if ( (fr = fopen(Dir, "r")) == NULL ) { + free(DirNew); + return(-1); + } + if ( (fw = fopen(DirNew, "w+")) == NULL ) { + free(DirNew); + return(-1); + } + fprintf(stderr, "DirNew: %s\n", DirNew); + chmod(Dir,0600); + chown(Dir,uid,gid); + + i = strlen(alias_line); + while (fgets(LineBuf, sizeof(LineBuf), fr)) { + if (strncmp(LineBuf, alias_line, i)) { + fputs(LineBuf, fw); + } + } + + fclose(fr); + fclose(fw); + rename(DirNew, Dir); + free(DirNew); + +#ifdef ONCHANGE_SCRIPT + if( allow_onchange ) { + /* tell other programs that data has changed */ + snprintf ( onchange_buf, MAX_BUFF, "%s@%s - %s", alias, domain, alias_line ); + call_onchange ( "valias_remove" ); + } +#endif + + return(0); } int valias_delete( char *alias, char *domain) Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.183 retrieving revision 1.184 diff -u -d -r1.183 -r1.184 --- ChangeLog 28 Oct 2007 08:59:40 -0000 1.183 +++ ChangeLog 29 Oct 2007 05:12:48 -0000 1.184 @@ -7,6 +7,7 @@ found. Instead, return "." only. Also indicate in help that per_page is optional. find_domain page numbers consistently start at 1. - update README.vpopmaild to reflect the above. + - Get valias_remove() working for cdb module. Rick Widmer - Arrange vpopmail.h based on libvpopmail categories (Start of v6 project) |
From: Rick W. <rw...@us...> - 2007-10-28 08:59:38
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3885 Modified Files: ChangeLog TODO vpopmail.h Log Message: Reorder vpopmail.h to follow wiki categories Index: TODO =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/TODO,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- TODO 29 Sep 2007 22:02:46 -0000 1.12 +++ TODO 28 Oct 2007 08:59:40 -0000 1.13 @@ -39,3 +39,5 @@ processed with a 32 bit value. All incoming off_t's must either stay off_t or go into a 64 bit value. Check courier's imap program for code on this. It should have a maildirquota.c file of its own. + +SHA or MD5 checksums for the tarball. Index: vpopmail.h =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpopmail.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- vpopmail.h 29 Sep 2007 23:17:35 -0000 1.32 +++ vpopmail.h 28 Oct 2007 08:59:40 -0000 1.33 @@ -140,24 +140,70 @@ #define NO_MAILDROP 0x40000 +typedef struct domain_entry { + char *domain; + char *realdomain; + int uid; + int gid; + char *path; + char *aliases[MAX_DOM_ALIAS]; +} domain_entry; + + extern int OptimizeAddDomain; extern int NoMakeIndex; extern int verrori; /* functions */ + +/* Alias Management */ +// these may be in their own .h file... + +/* Domain Management */ int vadddomain( char *domain, char *dir, uid_t uid, gid_t gid); +int vaddaliasdomain( char *alias_domain, char *real_domain); int vdeldomain( char *); +domain_entry *get_domain_entries( const char *match_real ); + + +/* User Management */ int vadduser( char *, char *, char *, char *, int); -int vdeluser( char *, char *); +void vgetpasswd( char *, char *, size_t); int vpasswd( char *, char *, char *, int); +int vdeluser( char *, char *); int vsetuserquota( char *, char *, char * ); +char *vget_assign(char *domain, char *dir, int dir_len, uid_t *uid, gid_t *gid); +void remove_maildirsize(char *dir); +void update_maildirsize(char *domain, char *dir, char *quota); + + +/* Low level string support */ +int parse_email( char *, char *, char *, int); +char *vrandom_pass (char *buffer, int len); +int is_username_valid( char *user ); +int is_domain_valid( char *domain ); +char *maildir_to_email(const char *maildir); + + +/* Operational Overhead */ int vexit(int err); int vexiterror( FILE *f, char *comment); + +/* Utility Functions */ +/* Low Level File System Management */ +int vdelfiles( char *); +int r_chown( char *, uid_t, gid_t); + + +/* Misc Functions */ +int vopen_smtp_relay(); +char *get_remote_ip(); + + +/* Not yet categorized */ char randltr(void); int mkpasswd3( char *, char *, int); -void vgetpasswd( char *, char *, size_t); -int vdelfiles( char *); int add_domain_assign( char *alias_domain, char *real_domain, char *dir, uid_t uid, gid_t gid); //int del_control( char *); @@ -166,10 +212,8 @@ char *real_domain, char *dir, uid_t uid, gid_t gid); int remove_lines( char *filename, char *aliases[MAX_DOM_ALIAS], int aliascount); -int r_chown( char *, uid_t, gid_t); int signal_process( char *, int ); int update_newu(); -int parse_email( char *, char *, char *, int); int add_user_assign( char *, char *); int del_user_assign( char *); void lowerit( char *); @@ -185,14 +229,12 @@ int pw_comp(char *, char *, char *, int); char *default_domain(); void vset_default_domain( char *); -int vopen_smtp_relay(); void vupdate_rules(int); void vclear_open_smtp(time_t, time_t); char *verror(int); int vadddotqmail(char *alias, char *domain,... ); int vdeldotqmail( char *alias, char *domain); int vget_real_domain(char *domain, int len ); -char *vget_assign(char *domain, char *dir, int dir_len, uid_t *uid, gid_t *gid); struct vqpasswd *vauth_user(char *user, char *domain, char *password, char *apop); int vmake_maildir(char *domain, char *dir); int vsqwebmail_pass( char *dir, char *crypted, uid_t uid, gid_t gid ); @@ -202,19 +244,11 @@ int vfd_move(int,int); int update_rules(); char *vversion(char *); -void remove_maildirsize(char *dir); -void update_maildirsize(char *domain, char *dir, char *quota); int vcheck_vqpw(struct vqpasswd *inpw, char *domain); char *vgen_pass(int len); -char *vrandom_pass (char *buffer, int len); int vvalidchar( char inchar ); -int is_username_valid( char *user ); -int is_domain_valid( char *domain ); -int vaddaliasdomain( char *alias_domain, char *real_domain); char *format_maildirquota(const char *q); char *date_header(); -char *get_remote_ip(); -char *maildir_to_email(const char *maildir); int qnprintf (char *buffer, size_t size, const char *format, ...); int readuserquota(const char* dir, long *sizep, int *cntp); #ifndef HAVE_WARN @@ -238,17 +272,6 @@ #endif -typedef struct domain_entry { - char *domain; - char *realdomain; - int uid; - int gid; - char *path; - char *aliases[MAX_DOM_ALIAS]; -} domain_entry; - -domain_entry *get_domain_entries( const char *match_real ); - void vsqlerror( FILE *f, char *comment ); // Error handling Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.182 retrieving revision 1.183 diff -u -d -r1.182 -r1.183 --- ChangeLog 27 Oct 2007 16:09:42 -0000 1.182 +++ ChangeLog 28 Oct 2007 08:59:40 -0000 1.183 @@ -8,6 +8,10 @@ optional. find_domain page numbers consistently start at 1. - update README.vpopmaild to reflect the above. + Rick Widmer + - Arrange vpopmail.h based on libvpopmail categories (Start of v6 project) + + 5.4.25 - Released 9-Oct-2007 Rick Widmer, Tom Collins - another try at signedness warnings in maildirquota and vchkpw |
From: Bill S. <sh...@us...> - 2007-10-27 16:22:32
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12725 Modified Files: README.vpopmaild Log Message: typo in README.vpopmaild Index: README.vpopmaild =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/README.vpopmaild,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- README.vpopmaild 27 Oct 2007 16:09:42 -0000 1.13 +++ README.vpopmaild 27 Oct 2007 16:22:34 -0000 1.14 @@ -460,7 +460,7 @@ Rights required: SA_ADMIN Action: Return the page number that the named domain appears on only if the -domain exist. Otherwise, just "." is returned. This can be used when you are +domain exists. Otherwise, just "." is returned. This can be used when you are using list_domains with the optional page and lines_per_page parameters. If you list the page returned by find_domain, the desired domain will appear on that page. It may not be at the top of the page. The page positions are fixed. |
From: Bill S. <sh...@us...> - 2007-10-27 16:09:44
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7390 Modified Files: ChangeLog README.vpopmaild vpopmaild.c Log Message: find_domain page number results now consistently start at 1 Index: README.vpopmaild =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/README.vpopmaild,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- README.vpopmaild 27 Oct 2007 15:39:29 -0000 1.12 +++ README.vpopmaild 27 Oct 2007 16:09:42 -0000 1.13 @@ -465,7 +465,7 @@ you list the page returned by find_domain, the desired domain will appear on that page. It may not be at the top of the page. The page positions are fixed. If no per_page argument is given, it defaults to one item per_page. Page -numbers start at 0. +numbers start at 1. -------------------------------------------------------------------- Index: vpopmaild.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpopmaild.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- vpopmaild.c 27 Oct 2007 15:39:29 -0000 1.35 +++ vpopmaild.c 27 Oct 2007 16:09:42 -0000 1.36 @@ -1769,7 +1769,7 @@ } else if( per_page > 0 ) { page = ( count / per_page ) + 1; } else { - page = count; + page = count + 1; } snprintf(WriteBuf,sizeof(WriteBuf), "page %i" RET_CRLF, page ); Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.181 retrieving revision 1.182 diff -u -d -r1.181 -r1.182 --- ChangeLog 27 Oct 2007 15:39:29 -0000 1.181 +++ ChangeLog 27 Oct 2007 16:09:42 -0000 1.182 @@ -4,9 +4,9 @@ 5.4.26 - unreleased Bill Shupp - vpopmaild fix: find_domain should not list 'page 0' when a domain is not - found. Instead, return "." only. Also indicate in help that per_page is - optional. - - update README.vpopmaild to reflect the above. + found. Instead, return "." only. Also indicate in help that per_page is + optional. find_domain page numbers consistently start at 1. + - update README.vpopmaild to reflect the above. 5.4.25 - Released 9-Oct-2007 Rick Widmer, Tom Collins |
From: Bill S. <sh...@us...> - 2007-10-27 15:39:32
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27597 Modified Files: ChangeLog README.vpopmaild vpopmaild.c Log Message: fix find_domain in vpopmaild: don't display 'page 0' when a domain doesn't exist Index: README.vpopmaild =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/README.vpopmaild,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- README.vpopmaild 17 Aug 2007 22:54:54 -0000 1.11 +++ README.vpopmaild 27 Oct 2007 15:39:29 -0000 1.12 @@ -459,12 +459,13 @@ Rights required: SA_ADMIN -Action: Return the page number that the named domain appears on. -This can be used when you are using list_domains with the optional -page and lines_per_page parameters. If you list the page returned -by find_domain, the desired domain will appear on that page. It -may not be at the top of the page. The page positions are fixed. - +Action: Return the page number that the named domain appears on only if the +domain exist. Otherwise, just "." is returned. This can be used when you are +using list_domains with the optional page and lines_per_page parameters. If +you list the page returned by find_domain, the desired domain will appear on +that page. It may not be at the top of the page. The page positions are fixed. +If no per_page argument is given, it defaults to one item per_page. Page +numbers start at 0. -------------------------------------------------------------------- Index: vpopmaild.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vpopmaild.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- vpopmaild.c 8 Sep 2007 17:53:26 -0000 1.34 +++ vpopmaild.c 27 Oct 2007 15:39:29 -0000 1.35 @@ -172,7 +172,7 @@ {2, "Domain", NULL, NULL}, {2, "user_info", user_info, "user_domain<crlf>" }, {3, "list_domains", list_domains, "[page per_page]<crlf>" }, -{3, "find_domain", find_domain, "domain per-page<crlf>" }, +{3, "find_domain", find_domain, "domain [per-page]<crlf>" }, {3, "domain_count", domain_count, "<crlf>" }, {3, "add_alias_domain", add_alias_domain, "domain alias<crlf>" }, {3, "add_domain", add_domain, "domain postmaster-password<crlf>" }, @@ -1764,7 +1764,8 @@ } if( miss ) { - page = 0; + snprintf(WriteBuf,sizeof(WriteBuf), "." RET_CRLF); + return(0); } else if( per_page > 0 ) { page = ( count / per_page ) + 1; } else { Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.180 retrieving revision 1.181 diff -u -d -r1.180 -r1.181 --- ChangeLog 19 Oct 2007 07:32:26 -0000 1.180 +++ ChangeLog 27 Oct 2007 15:39:29 -0000 1.181 @@ -2,6 +2,11 @@ or info related to the entry. <http://sourceforge.net/projects/vpopmail/> 5.4.26 - unreleased + Bill Shupp + - vpopmaild fix: find_domain should not list 'page 0' when a domain is not + found. Instead, return "." only. Also indicate in help that per_page is + optional. + - update README.vpopmaild to reflect the above. 5.4.25 - Released 9-Oct-2007 Rick Widmer, Tom Collins |
From: Rick W. <rw...@us...> - 2007-10-19 07:32:24
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1834 Modified Files: ChangeLog configure configure.in Log Message: start 1.4.26 Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.179 retrieving revision 1.180 diff -u -d -r1.179 -r1.180 --- ChangeLog 10 Oct 2007 03:07:54 -0000 1.179 +++ ChangeLog 19 Oct 2007 07:32:26 -0000 1.180 @@ -1,6 +1,8 @@ Numbers in square brackets ([]) are tracker items on SourceForge with patch or info related to the entry. <http://sourceforge.net/projects/vpopmail/> +5.4.26 - unreleased + 5.4.25 - Released 9-Oct-2007 Rick Widmer, Tom Collins - another try at signedness warnings in maildirquota and vchkpw Index: configure =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- configure 30 Sep 2007 02:11:14 -0000 1.49 +++ configure 19 Oct 2007 07:32:26 -0000 1.50 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for vpopmail 5.4.25. +# Generated by GNU Autoconf 2.60 for vpopmail 5.4.26. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -557,8 +557,8 @@ # Identity of this package. PACKAGE_NAME='vpopmail' PACKAGE_TARNAME='vpopmail' -PACKAGE_VERSION='5.4.25' -PACKAGE_STRING='vpopmail 5.4.25' +PACKAGE_VERSION='5.4.26' +PACKAGE_STRING='vpopmail 5.4.26' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -1204,7 +1204,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vpopmail 5.4.25 to adapt to many kinds of systems. +\`configure' configures vpopmail 5.4.26 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1274,7 +1274,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vpopmail 5.4.25:";; + short | recursive ) echo "Configuration of vpopmail 5.4.26:";; esac cat <<\_ACEOF @@ -1397,7 +1397,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vpopmail configure 5.4.25 +vpopmail configure 5.4.26 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1411,7 +1411,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vpopmail $as_me 5.4.25, which was +It was created by vpopmail $as_me 5.4.26, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -2086,7 +2086,7 @@ # Define the identity of the package. PACKAGE='vpopmail' - VERSION='5.4.25' + VERSION='5.4.26' cat >>confdefs.h <<_ACEOF @@ -8992,7 +8992,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vpopmail $as_me 5.4.25, which was +This file was extended by vpopmail $as_me 5.4.26, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9045,7 +9045,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -vpopmail config.status 5.4.25 +vpopmail config.status 5.4.26 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Index: configure.in =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure.in,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- configure.in 30 Sep 2007 02:11:14 -0000 1.46 +++ configure.in 19 Oct 2007 07:32:26 -0000 1.47 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.52]) -AC_INIT(vpopmail,5.4.25) +AC_INIT(vpopmail,5.4.26) PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION |
From: Rick W. <rw...@us...> - 2007-10-10 03:07:57
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21885 Modified Files: ChangeLog Log Message: set release date for 5.4.25 Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.178 retrieving revision 1.179 diff -u -d -r1.178 -r1.179 --- ChangeLog 1 Oct 2007 22:31:06 -0000 1.178 +++ ChangeLog 10 Oct 2007 03:07:54 -0000 1.179 @@ -1,10 +1,10 @@ Numbers in square brackets ([]) are tracker items on SourceForge with patch or info related to the entry. <http://sourceforge.net/projects/vpopmail/> -5.4.25 - unreleased +5.4.25 - Released 9-Oct-2007 Rick Widmer, Tom Collins - another try at signedness warnings in maildirquota and vchkpw - + - minor change in README.vdelivermail 5.4.24 - Released 29-Sep-2007 |
From: Rick W. <rw...@us...> - 2007-10-10 03:02:15
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19039 Modified Files: README.vdelivermail Log Message: minor change in README.vdelivermail Index: README.vdelivermail =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/README.vdelivermail,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README.vdelivermail 13 Jul 2007 22:21:01 -0000 1.1 +++ README.vdelivermail 10 Oct 2007 03:02:13 -0000 1.2 @@ -51,7 +51,7 @@ In summary... the .qmail-default of every virtual domain MUST contain ONLY a single line that executes vdelivermail. The ONLY place you should EVER call vdelivermail -is from the .qmail-default directory of a vpopmail based virtual domain. There are +is from the .qmail-default file of a vpopmail based virtual domain. There are four possible delivery options for non-existant mailboxes that must be the second parameter to vdelivermail. The empty first parameter is required. |
From: Rick W. <rw...@us...> - 2007-10-01 22:31:05
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16357 Modified Files: ChangeLog vchkpw.c Log Message: change to using cast in vchkpw Index: vchkpw.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vchkpw.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- vchkpw.c 1 Oct 2007 06:59:55 -0000 1.20 +++ vchkpw.c 1 Oct 2007 22:31:06 -0000 1.21 @@ -739,23 +739,12 @@ int authcram( char *response, char *challenge, char *password) { - unsigned char *uchallenge; - unsigned char *upassword; unsigned char digest[16]; char digascii[33]; unsigned char h; int j; - uchallenge = malloc( strlen(challenge)+1); - memcpy( uchallenge, challenge, strlen( challenge )); - - upassword = malloc( strlen(password)+1); - memcpy( upassword, password, strlen(password)+1); - - hmac_md5( uchallenge, strlen(challenge), upassword, strlen(password), digest); - - free( uchallenge ); - free( upassword ); + hmac_md5( (unsigned char *) challenge, strlen(challenge), (unsigned char *) password, strlen(password), digest); digascii[32]=0; Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.177 retrieving revision 1.178 diff -u -d -r1.177 -r1.178 --- ChangeLog 1 Oct 2007 06:59:55 -0000 1.177 +++ ChangeLog 1 Oct 2007 22:31:06 -0000 1.178 @@ -2,10 +2,11 @@ or info related to the entry. <http://sourceforge.net/projects/vpopmail/> 5.4.25 - unreleased - Rick Widmer + Rick Widmer, Tom Collins - another try at signedness warnings in maildirquota and vchkpw + 5.4.24 - Released 29-Sep-2007 Rick Widmer, Tom Collins - fix off_t warnings in maildirquota.c when mysql back end is used. |
From: Rick W. <rw...@us...> - 2007-10-01 06:59:53
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29592 Modified Files: ChangeLog config.h.in maildirquota.c vchkpw.c Log Message: another attempt at signedness warnings Index: vchkpw.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vchkpw.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- vchkpw.c 22 May 2007 03:59:00 -0000 1.19 +++ vchkpw.c 1 Oct 2007 06:59:55 -0000 1.20 @@ -92,8 +92,8 @@ void vlog(int verror, char *TheUser, char *TheDomain, char *ThePass, char *TheName, char *IpAddr, char *LogLine); void vchkpw_exit(int err); void run_command(char *prog); -int authcram(unsigned char *response, unsigned char *challenge, unsigned char *password); -int authapop(unsigned char *password, unsigned char *timestamp, unsigned char *clearpass); +int authcram( char *response, char *challenge, char *password); +int authapop( char *password, char *timestamp, char *clearpass); #define POP_CONN 0 #define SMTP_CONN 1 @@ -737,14 +737,25 @@ #endif } -int authcram(unsigned char *response, unsigned char *challenge, unsigned char *password) +int authcram( char *response, char *challenge, char *password) { + unsigned char *uchallenge; + unsigned char *upassword; unsigned char digest[16]; - unsigned char digascii[33]; + char digascii[33]; unsigned char h; int j; - hmac_md5( challenge, strlen(challenge), password, strlen(password), digest); + uchallenge = malloc( strlen(challenge)+1); + memcpy( uchallenge, challenge, strlen( challenge )); + + upassword = malloc( strlen(password)+1); + memcpy( upassword, password, strlen(password)+1); + + hmac_md5( uchallenge, strlen(challenge), upassword, strlen(password), digest); + + free( uchallenge ); + free( upassword ); digascii[32]=0; @@ -759,18 +770,31 @@ return(strcmp(digascii,response)); } -int authapop(unsigned char *password, unsigned char *timestamp, unsigned char *clearpass) +int authapop( char *password, char *timestamp, char *clearpass) { MD5_CTX context; unsigned char digest[16]; char encrypted[16*2+1]; char *s; int i; - + + unsigned char *utimestamp; + unsigned char *uclearpass; + + utimestamp = malloc( strlen( timestamp )); + memcpy( utimestamp, timestamp, strlen( timestamp )); + + uclearpass = malloc( strlen( clearpass )); + memcpy( uclearpass, clearpass, strlen( clearpass )); + MD5Init(&context); - MD5Update(&context, timestamp, strlen(timestamp)); - MD5Update(&context, clearpass, strlen(clearpass)); + MD5Update(&context, utimestamp, strlen(timestamp)); + MD5Update(&context, uclearpass, strlen(clearpass)); MD5Final(digest, &context); + + free( utimestamp ); + free( uclearpass ); + s = encrypted; for (i = 0; i < (int)sizeof(digest); ++i) { *s = hextab[digest[i]/16]; ++s; Index: config.h.in =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/config.h.in,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- config.h.in 22 May 2007 03:58:58 -0000 1.15 +++ config.h.in 1 Oct 2007 06:59:55 -0000 1.16 @@ -354,13 +354,13 @@ /* Define to `int' if <sys/types.h> does not define. */ #undef mode_t -/* Define to `long' if <sys/types.h> does not define. */ +/* Define to `long int' if <sys/types.h> does not define. */ #undef off_t /* Define to `int' if <sys/types.h> does not define. */ #undef pid_t -/* Define to `unsigned' if <sys/types.h> does not define. */ +/* Define to `unsigned int' if <sys/types.h> does not define. */ #undef size_t /* Define to `int' if <sys/types.h> doesn't define. */ Index: maildirquota.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/maildirquota.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- maildirquota.c 29 Sep 2007 22:02:46 -0000 1.16 +++ maildirquota.c 1 Oct 2007 06:59:55 -0000 1.17 @@ -1,6 +1,6 @@ /* * $Id$ - * Copyright (C) 1999-2003 Inter7 Internet Technologies, Inc. + * Copyright (C) 1999-2004 Inter7 Internet Technologies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,22 +37,23 @@ #include "config.h" /* private functions - no name clashes with courier */ -static char *makenewmaildirsizename(const char *sizep, int *cntp ); -static int countcurnew(const char *dir, time_t *, off_t *sizep, unsigned *cntp ); -static int countsubdir(const char *dir, const char *, - time_t *, off_t *, unsigned *); +static char *makenewmaildirsizename(const char *, int *); +static int countcurnew(const char *, time_t *, off_t *, int *); +static int countsubdir(const char *, const char *, + time_t *, off_t *, int *); static int statcurnew(const char *, time_t *); static int statsubdir(const char *, const char *, time_t *); static int doaddquota(const char *, int, const char *, long, int, int); static int docheckquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, long xtra_size, int xtra_cnt, int *percentage); -static int docount(const char *, time_t *, off_t *, unsigned *); +static int docount(const char *, time_t *, off_t *, int *); static int maildir_checkquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, long xtra_size, int xtra_cnt); -/* moved into maildirquota.h as non-static +/* static int maildir_addquota(const char *dir, int maildirsize_fd, const char *quota_type, long maildirsize_size, int maildirsize_cnt); */ + static int maildir_safeopen(const char *path, int mode, int perm); static char *str_pid_t(pid_t t, char *arg); static char *str_time_t(time_t t, char *arg); @@ -73,7 +74,7 @@ char domdir[MAX_PW_DIR]; char *p; char domain[256]; -long size = 0; +long size = 0; unsigned long maxsize = 0; int cnt = 0; int maxcnt = 0; @@ -98,9 +99,6 @@ maxsize = limits.diskquota * 1024 * 1024; maxcnt = limits.maxmsgcount; - /* only check the quota if one is set. */ - if ((maxsize == 0) && (maxcnt == 0)) return 0; - if (vget_assign (domain, domdir, sizeof(domdir), NULL, NULL) == NULL) return -1; @@ -171,7 +169,7 @@ return 0; } -int wrapreaduserquota(const char* dir, long *sizep, unsigned int *cntp) +int wrapreaduserquota(const char* dir, off_t *sizep, int *cntp) { time_t tm; time_t maxtime; @@ -248,38 +246,64 @@ { int retval; off_t s; - unsigned c; - s = ( off_t ) *sizep; - c = *cntp; - retval = wrapreaduserquota(dir, &s, &c); + + s = (off_t) *sizep; + retval = wrapreaduserquota(dir, &s, cntp); *sizep = (long) s; - *cntp = (int) c; return retval; } int user_over_maildirquota( const char *dir, const char *q) { struct stat stat_buf; -int quotafd = -1; -int ret_value = 0; +int quotafd; +int ret_value; if (fstat(0, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode) && stat_buf.st_size > 0 && *q) { - ret_value = (maildir_checkquota(dir, "afd, q, stat_buf.st_size, 1) - && errno != EAGAIN); + if (maildir_checkquota(dir, "afd, q, stat_buf.st_size, 1) + && errno != EAGAIN) + { + if (quotafd >= 0) close(quotafd); + ret_value = 1; + } else { + maildir_addquota(dir, quotafd, q, stat_buf.st_size, 1); + if (quotafd >= 0) close(quotafd); + ret_value = 0; + } + } else { + ret_value = 0; } - if (quotafd != -1) close(quotafd); return(ret_value); } +void add_warningsize_to_quota( const char *dir, const char *q) +{ +struct stat stat_buf; +int quotafd; +char quotawarnmsg[500]; + + snprintf(quotawarnmsg, sizeof(quotawarnmsg), "%s/%s/.quotawarn.msg", VPOPMAILDIR, DOMAINS_DIR); + + if (stat(quotawarnmsg, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode) && + stat_buf.st_size > 0 && *q) + { + maildir_checkquota(dir, "afd, q, stat_buf.st_size, 1); + if (quotafd >= 0) close(quotafd); + maildir_addquota(dir, quotafd, q, + stat_buf.st_size, 1); + if (quotafd >= 0) close(quotafd); + } +} + /* Read the maildirsize file */ static int maildirsize_read(const char *filename, /* The filename */ int *fdptr, /* Keep the file descriptor open */ off_t *sizeptr, /* Grand total of maildir size */ - unsigned *cntptr, /* Grand total of message count */ + int *cntptr, /* Grand total of message count */ unsigned *nlines, /* # of lines in maildirsize */ struct stat *statptr) /* The stats on maildirsize */ { @@ -439,9 +463,9 @@ char *checkfolder=(char *)malloc(strlen(dir)+sizeof("/maildirfolder")); char *newmaildirsizename; struct stat stat_buf; -int maildirsize_fd = -1; +int maildirsize_fd; off_t maildirsize_size; -unsigned maildirsize_cnt; +int maildirsize_cnt; unsigned maildirsize_nlines; int n; time_t tm; @@ -483,8 +507,6 @@ return (n); } - /* rebuild the maildirsize file */ - maxtime=0; maildirsize_size=0; maildirsize_cnt=0; @@ -531,10 +553,10 @@ if (doaddquota(dir, maildirsize_fd, quota_type, maildirsize_size, maildirsize_cnt, 1)) { + free(newmaildirsizename); unlink(newmaildirsizename); close(maildirsize_fd); *maildirsize_fdptr= -1; - free(newmaildirsizename); free(checkfolder); return (-1); } @@ -543,6 +565,7 @@ if (rename(newmaildirsizename, checkfolder)) { + free(checkfolder); unlink(newmaildirsizename); close(maildirsize_fd); *maildirsize_fdptr= -1; @@ -789,7 +812,8 @@ return (n); } -static int countcurnew(const char *dir, time_t *maxtime, off_t *sizep, unsigned int *cntp) +static int countcurnew(const char *dir, time_t *maxtime, + off_t *sizep, int *cntp) { char *p=(char *)malloc(strlen(dir)+5); int n; @@ -807,7 +831,7 @@ } static int countsubdir(const char *dir, const char *subdir, time_t *maxtime, - off_t *sizep, unsigned *cntp) + off_t *sizep, int *cntp) { char *p; int n; @@ -825,8 +849,7 @@ } static int docount(const char *dir, time_t *dirstamp, - off_t *sizep, unsigned *cntp) - + off_t *sizep, int *cntp) { struct stat stat_buf; char *p; Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.176 retrieving revision 1.177 diff -u -d -r1.176 -r1.177 --- ChangeLog 30 Sep 2007 02:11:14 -0000 1.176 +++ ChangeLog 1 Oct 2007 06:59:55 -0000 1.177 @@ -2,6 +2,8 @@ or info related to the entry. <http://sourceforge.net/projects/vpopmail/> 5.4.25 - unreleased + Rick Widmer + - another try at signedness warnings in maildirquota and vchkpw 5.4.24 - Released 29-Sep-2007 |
From: Rick W. <rw...@us...> - 2007-10-01 06:34:39
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19716 Modified Files: Tag: v5_4_24 config.h.in maildirquota.c vchkpw.c Log Message: fix signedness warnings in maildirquota and vchkpw Index: vchkpw.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vchkpw.c,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -d -r1.19 -r1.19.2.1 --- vchkpw.c 22 May 2007 03:59:00 -0000 1.19 +++ vchkpw.c 1 Oct 2007 06:34:29 -0000 1.19.2.1 @@ -92,8 +92,8 @@ void vlog(int verror, char *TheUser, char *TheDomain, char *ThePass, char *TheName, char *IpAddr, char *LogLine); void vchkpw_exit(int err); void run_command(char *prog); -int authcram(unsigned char *response, unsigned char *challenge, unsigned char *password); -int authapop(unsigned char *password, unsigned char *timestamp, unsigned char *clearpass); +int authcram( char *response, char *challenge, char *password); +int authapop( char *password, char *timestamp, char *clearpass); #define POP_CONN 0 #define SMTP_CONN 1 @@ -737,14 +737,25 @@ #endif } -int authcram(unsigned char *response, unsigned char *challenge, unsigned char *password) +int authcram( char *response, char *challenge, char *password) { + unsigned char *uchallenge; + unsigned char *upassword; unsigned char digest[16]; - unsigned char digascii[33]; + char digascii[33]; unsigned char h; int j; - hmac_md5( challenge, strlen(challenge), password, strlen(password), digest); + uchallenge = malloc( strlen(challenge)+1); + memcpy( uchallenge, challenge, strlen( challenge )); + + upassword = malloc( strlen(password)+1); + memcpy( upassword, password, strlen(password)+1); + + hmac_md5( uchallenge, strlen(challenge), upassword, strlen(password), digest); + + free( uchallenge ); + free( upassword ); digascii[32]=0; @@ -759,18 +770,31 @@ return(strcmp(digascii,response)); } -int authapop(unsigned char *password, unsigned char *timestamp, unsigned char *clearpass) +int authapop( char *password, char *timestamp, char *clearpass) { MD5_CTX context; unsigned char digest[16]; char encrypted[16*2+1]; char *s; int i; - + + unsigned char *utimestamp; + unsigned char *uclearpass; + + utimestamp = malloc( strlen( timestamp )); + memcpy( utimestamp, timestamp, strlen( timestamp )); + + uclearpass = malloc( strlen( clearpass )); + memcpy( uclearpass, clearpass, strlen( clearpass )); + MD5Init(&context); - MD5Update(&context, timestamp, strlen(timestamp)); - MD5Update(&context, clearpass, strlen(clearpass)); + MD5Update(&context, utimestamp, strlen(timestamp)); + MD5Update(&context, uclearpass, strlen(clearpass)); MD5Final(digest, &context); + + free( utimestamp ); + free( uclearpass ); + s = encrypted; for (i = 0; i < (int)sizeof(digest); ++i) { *s = hextab[digest[i]/16]; ++s; Index: config.h.in =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/config.h.in,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -d -r1.15 -r1.15.2.1 --- config.h.in 22 May 2007 03:58:58 -0000 1.15 +++ config.h.in 1 Oct 2007 06:34:29 -0000 1.15.2.1 @@ -354,13 +354,13 @@ /* Define to `int' if <sys/types.h> does not define. */ #undef mode_t -/* Define to `long' if <sys/types.h> does not define. */ +/* Define to `long int' if <sys/types.h> does not define. */ #undef off_t /* Define to `int' if <sys/types.h> does not define. */ #undef pid_t -/* Define to `unsigned' if <sys/types.h> does not define. */ +/* Define to `unsigned int' if <sys/types.h> does not define. */ #undef size_t /* Define to `int' if <sys/types.h> doesn't define. */ Index: maildirquota.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/maildirquota.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- maildirquota.c 14 Mar 2004 18:00:40 -0000 1.8 +++ maildirquota.c 1 Oct 2007 06:34:29 -0000 1.8.2.1 @@ -38,19 +38,22 @@ /* private functions - no name clashes with courier */ static char *makenewmaildirsizename(const char *, int *); -static int countcurnew(const char *, time_t *, off_t *, unsigned *); +static int countcurnew(const char *, time_t *, off_t *, int *); static int countsubdir(const char *, const char *, - time_t *, off_t *, unsigned *); + time_t *, off_t *, int *); static int statcurnew(const char *, time_t *); static int statsubdir(const char *, const char *, time_t *); static int doaddquota(const char *, int, const char *, long, int, int); static int docheckquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, long xtra_size, int xtra_cnt, int *percentage); -static int docount(const char *, time_t *, off_t *, unsigned *); +static int docount(const char *, time_t *, off_t *, int *); static int maildir_checkquota(const char *dir, int *maildirsize_fdptr, const char *quota_type, long xtra_size, int xtra_cnt); +/* static int maildir_addquota(const char *dir, int maildirsize_fd, const char *quota_type, long maildirsize_size, int maildirsize_cnt); +*/ + static int maildir_safeopen(const char *path, int mode, int perm); static char *str_pid_t(pid_t t, char *arg); static char *str_time_t(time_t t, char *arg); @@ -71,7 +74,7 @@ char domdir[MAX_PW_DIR]; char *p; char domain[256]; -unsigned long size = 0; +long size = 0; unsigned long maxsize = 0; int cnt = 0; int maxcnt = 0; @@ -300,7 +303,7 @@ static int maildirsize_read(const char *filename, /* The filename */ int *fdptr, /* Keep the file descriptor open */ off_t *sizeptr, /* Grand total of maildir size */ - unsigned *cntptr, /* Grand total of message count */ + int *cntptr, /* Grand total of message count */ unsigned *nlines, /* # of lines in maildirsize */ struct stat *statptr) /* The stats on maildirsize */ { @@ -462,7 +465,7 @@ struct stat stat_buf; int maildirsize_fd; off_t maildirsize_size; -unsigned maildirsize_cnt; +int maildirsize_cnt; unsigned maildirsize_nlines; int n; time_t tm; @@ -614,7 +617,7 @@ quota_type, percentage)); } -static int maildir_addquota(const char *dir, int maildirsize_fd, +int maildir_addquota(const char *dir, int maildirsize_fd, const char *quota_type, long maildirsize_size, int maildirsize_cnt) { if (!quota_type || !*quota_type) return (0); @@ -810,7 +813,7 @@ } static int countcurnew(const char *dir, time_t *maxtime, - off_t *sizep, unsigned *cntp) + off_t *sizep, int *cntp) { char *p=(char *)malloc(strlen(dir)+5); int n; @@ -828,7 +831,7 @@ } static int countsubdir(const char *dir, const char *subdir, time_t *maxtime, - off_t *sizep, unsigned *cntp) + off_t *sizep, int *cntp) { char *p; int n; @@ -846,7 +849,7 @@ } static int docount(const char *dir, time_t *dirstamp, - off_t *sizep, unsigned *cntp) + off_t *sizep, int *cntp) { struct stat stat_buf; char *p; |
From: Rick W. <rw...@us...> - 2007-09-30 02:11:14
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25954 Modified Files: ChangeLog configure configure.in Log Message: start of 5.4.25 release Index: ChangeLog =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/ChangeLog,v retrieving revision 1.175 retrieving revision 1.176 diff -u -d -r1.175 -r1.176 --- ChangeLog 30 Sep 2007 02:05:09 -0000 1.175 +++ ChangeLog 30 Sep 2007 02:11:14 -0000 1.176 @@ -1,6 +1,9 @@ Numbers in square brackets ([]) are tracker items on SourceForge with patch or info related to the entry. <http://sourceforge.net/projects/vpopmail/> +5.4.25 - unreleased + + 5.4.24 - Released 29-Sep-2007 Rick Widmer, Tom Collins - fix off_t warnings in maildirquota.c when mysql back end is used. Index: configure =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- configure 23 Sep 2007 23:38:12 -0000 1.48 +++ configure 30 Sep 2007 02:11:14 -0000 1.49 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for vpopmail 5.4.24. +# Generated by GNU Autoconf 2.60 for vpopmail 5.4.25. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -557,8 +557,8 @@ # Identity of this package. PACKAGE_NAME='vpopmail' PACKAGE_TARNAME='vpopmail' -PACKAGE_VERSION='5.4.24' -PACKAGE_STRING='vpopmail 5.4.24' +PACKAGE_VERSION='5.4.25' +PACKAGE_STRING='vpopmail 5.4.25' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -1204,7 +1204,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vpopmail 5.4.24 to adapt to many kinds of systems. +\`configure' configures vpopmail 5.4.25 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1274,7 +1274,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vpopmail 5.4.24:";; + short | recursive ) echo "Configuration of vpopmail 5.4.25:";; esac cat <<\_ACEOF @@ -1397,7 +1397,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vpopmail configure 5.4.24 +vpopmail configure 5.4.25 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1411,7 +1411,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vpopmail $as_me 5.4.24, which was +It was created by vpopmail $as_me 5.4.25, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -2086,7 +2086,7 @@ # Define the identity of the package. PACKAGE='vpopmail' - VERSION='5.4.24' + VERSION='5.4.25' cat >>confdefs.h <<_ACEOF @@ -8992,7 +8992,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vpopmail $as_me 5.4.24, which was +This file was extended by vpopmail $as_me 5.4.25, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9045,7 +9045,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -vpopmail config.status 5.4.24 +vpopmail config.status 5.4.25 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Index: configure.in =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/configure.in,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- configure.in 23 Sep 2007 23:38:12 -0000 1.45 +++ configure.in 30 Sep 2007 02:11:14 -0000 1.46 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.52]) -AC_INIT(vpopmail,5.4.24) +AC_INIT(vpopmail,5.4.25) PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION |