Update of /cvsroot/qmailadmin/qmailadmin In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7128 Modified Files: Tag: stable-1_2 ChangeLog config.h.in configure configure.in qmailadmin.c user.c Log Message: Add --disable-catchall and --disable-trivial-password options to configure scripts. (from Simone Lazzaris) Index: config.h.in =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/config.h.in,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -u -d -r1.5.2.2 -r1.5.2.3 --- config.h.in 8 May 2006 05:22:34 -0000 1.5.2.2 +++ config.h.in 2 May 2009 19:13:29 -0000 1.5.2.3 @@ -4,6 +4,9 @@ #undef AUTORESPOND_PATH /* "" */ +#undef CATCHALL_ENABLED + +/* "" */ #undef CGIPATH /* Define to 1 if the `closedir' function returns void instead of `int'. */ @@ -157,6 +160,9 @@ #undef STDC_HEADERS /* "" */ +#undef TRIVIAL_PASSWORD_ENABLED + +/* "" */ #undef USER_INDEX /* "" */ Index: configure =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/configure,v retrieving revision 1.14.2.18 retrieving revision 1.14.2.19 diff -u -d -r1.14.2.18 -r1.14.2.19 --- configure 8 Jan 2008 03:56:14 -0000 1.14.2.18 +++ configure 2 May 2009 19:13:29 -0000 1.14.2.19 @@ -871,6 +871,8 @@ --disable-user-index Don't display user index on show users page. --enable-modify-quota Allow domain admin (postmaster) to modify user quotas. --enable-domain-autofill Autofill the domain on login page based on the hostname that accesses qmailadmin. + --disable-catchall Disable the use of catchall accounts. + --disable-trivial-password Disable the use of trivial password. --enable-spamcmd-needs-email Append the user's email to the end of the spam command. --enable-modify-spam Allow users to enable/disable spam checking. --enable-spam-command=CMD Remember to use '|preline' at the beginning, |preline /usr/local/bin/maildrop /etc/mailfilter. @@ -4886,6 +4888,54 @@ ;; esac + +CATCHALL_ENABLED=yes +# Check whether --enable-catchall or --disable-catchall was given. +if test "${enable_catchall+set}" = set; then + enableval="$enable_catchall" + CATCHALL_ENABLED="$enableval" +fi; + +case $CATCHALL_ENABLED in +1*|y*|Y*) + CATCHALL_ENABLED=yes + +cat >>confdefs.h <<_ACEOF +#define CATCHALL_ENABLED 1 +_ACEOF + + echo "checking whether to enable catchall accounts... yes" + ;; +*) + CATCHALL_ENABLED=no + echo "checking whether to enable catchall accounts... no" + ;; +esac + + +TRIVIAL_PASSWORD_ENABLED=yes +# Check whether --enable-trivial-password or --disable-trivial-password was given. +if test "${enable_trivial_password+set}" = set; then + enableval="$enable_trivial_password" + TRIVIAL_PASSWORD_ENABLED="$enableval" +fi; + +case $TRIVIAL_PASSWORD_ENABLED in +1*|y*|Y*) + TRIVIAL_PASSWORD_ENABLED=yes + +cat >>confdefs.h <<_ACEOF +#define TRIVIAL_PASSWORD_ENABLED 1 +_ACEOF + + echo "checking whether to enable trivial password... yes" + ;; +*) + TRIVIAL_PASSWORD_ENABLED=no + echo "checking whether to enable trivial password... no" + ;; +esac + # Check whether --enable-spamcmd-needs-email or --disable-spamcmd-needs-email was given. if test "${enable_spamcmd_needs_email+set}" = set; then enableval="$enable_spamcmd_needs_email" @@ -6407,6 +6457,8 @@ echo " help = "$enable_help"" echo " modify quota = "$MODIFY_QUOTA"" echo " domain autofill = "$DOMAIN_AUTOFILL"" +echo " catchall accounts = "$CATCHALL_ENABLED"" +echo " trivial passwords = "$TRIVIAL_PASSWORD_ENABLED"" echo " modify spam check = "$MODIFY_SPAM"" if test "$MODIFY_SPAM" = "yes" then Index: configure.in =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/configure.in,v retrieving revision 1.15.2.18 retrieving revision 1.15.2.19 diff -u -d -r1.15.2.18 -r1.15.2.19 --- configure.in 8 Jan 2008 03:56:14 -0000 1.15.2.18 +++ configure.in 2 May 2009 19:13:29 -0000 1.15.2.19 @@ -350,6 +350,40 @@ ;; esac + +CATCHALL_ENABLED=yes +AC_ARG_ENABLE(catchall, [ --disable-catchall Disable the use of catchall accounts.], + CATCHALL_ENABLED="$enableval",) + +case $CATCHALL_ENABLED in +1*|y*|Y*) + CATCHALL_ENABLED=yes + AC_DEFINE_UNQUOTED(CATCHALL_ENABLED,1,"") + echo "checking whether to enable catchall accounts... yes" + ;; +*) + CATCHALL_ENABLED=no + echo "checking whether to enable catchall accounts... no" + ;; +esac + + +TRIVIAL_PASSWORD_ENABLED=yes +AC_ARG_ENABLE(trivial-password, [ --disable-trivial-password Disable the use of trivial password.], + TRIVIAL_PASSWORD_ENABLED="$enableval",) + +case $TRIVIAL_PASSWORD_ENABLED in +1*|y*|Y*) + TRIVIAL_PASSWORD_ENABLED=yes + AC_DEFINE_UNQUOTED(TRIVIAL_PASSWORD_ENABLED,1,"") + echo "checking whether to enable trivial password... yes" + ;; +*) + TRIVIAL_PASSWORD_ENABLED=no + echo "checking whether to enable trivial password... no" + ;; +esac + AC_ARG_ENABLE(spamcmd-needs-email, [ --enable-spamcmd-needs-email Append the user's email to the end of the spam command.], SPAM_NEED_EMAIL="$enableval",) @@ -444,6 +478,8 @@ echo " help = "$enable_help"" echo " modify quota = "$MODIFY_QUOTA"" echo " domain autofill = "$DOMAIN_AUTOFILL"" +echo " catchall accounts = "$CATCHALL_ENABLED"" +echo " trivial passwords = "$TRIVIAL_PASSWORD_ENABLED"" echo " modify spam check = "$MODIFY_SPAM"" if test "$MODIFY_SPAM" = "yes" then Index: qmailadmin.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/qmailadmin.c,v retrieving revision 1.6.2.15 retrieving revision 1.6.2.16 diff -u -d -r1.6.2.15 -r1.6.2.16 --- qmailadmin.c 2 May 2009 18:21:14 -0000 1.6.2.15 +++ qmailadmin.c 2 May 2009 19:13:29 -0000 1.6.2.16 @@ -223,6 +223,10 @@ snprintf (StatusMessage, sizeof(StatusMessage), "%s", html_text[234]); } else if (vpasswd (User, Domain, Password1, USE_POP) != VA_SUCCESS) { snprintf (StatusMessage, sizeof(StatusMessage), "%s", html_text[140]); +#ifndef TRIVIAL_PASSWORD_ENABLED + } else if ( strstr(User,Password1)!=NULL) { + snprintf (StatusMessage, sizeof(StatusMessage), "%s\n", html_text[320]); +#endif } else { /* success */ snprintf (StatusMessage, sizeof(StatusMessage), "%s", html_text[139]); Index: ChangeLog =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/ChangeLog,v retrieving revision 1.15.2.120 retrieving revision 1.15.2.121 diff -u -d -r1.15.2.120 -r1.15.2.121 --- ChangeLog 2 May 2009 18:22:25 -0000 1.15.2.120 +++ ChangeLog 2 May 2009 19:13:29 -0000 1.15.2.121 @@ -3,6 +3,10 @@ 1.2.13 - released 2-May-09 + Simone Lazzaris + - Add --disable-catchall and --disable-trivial-password options + to configure scripts. + Tom Collins - qmailadmin.c: check return value of setuid() and setgid() and exit if either fail (security issue reported by Miguel Lourenco). Index: user.c =================================================================== RCS file: /cvsroot/qmailadmin/qmailadmin/user.c,v retrieving revision 1.11.2.20 retrieving revision 1.11.2.21 diff -u -d -r1.11.2.20 -r1.11.2.21 --- user.c 3 Nov 2007 17:44:12 -0000 1.11.2.20 +++ user.c 2 May 2009 19:13:29 -0000 1.11.2.21 @@ -81,6 +81,7 @@ int colspan = 7; int allowdelete; char qconvert[11]; + int bars; if (MaxPopAccounts == 0) return 0; @@ -223,17 +224,18 @@ if (bounced==0 && strncmp(pw->pw_name,TmpBuf3,sizeof(TmpBuf3)) == 0) { printf ("<img src=\"%s/radio-on.png\" border=\"0\"></a>", IMAGEURL); +#ifdef CATCHALL_ENABLED } else if (AdminType==DOMAIN_ADMIN) { printh ("<a href=\"%s&deluser=%C&page=%s\">", cgiurl("setdefault"), pw->pw_name, Pagenumber); printf ("<img src=\"%s/radio-off.png\" border=\"0\"></a>", IMAGEURL); +#endif } else { printf ("<img src=\"%s/disabled.png\" border=\"0\">", IMAGEURL); } printf ("</td>"); - printf ("</tr>\n"); } pw = vauth_getall(dom,0,0); @@ -246,29 +248,33 @@ printf ("<tr bgcolor=%s>", get_color_text("000")); printf ("<td colspan=\"%i\" align=\"right\">", colspan); -#ifdef USER_INDEX printf ("<font size=\"2\"><b>"); printf ("[ "); + bars = 0; +#ifdef USER_INDEX /* only display "previous page" if pagenumber > 1 */ if (atoi(Pagenumber) > 1) { printh ("<a href=\"%s&page=%d\">%s</a>", cgiurl ("showusers"), atoi(Pagenumber)-1 ? atoi(Pagenumber)-1 : atoi(Pagenumber), html_text[135]); - printf (" | "); + bars = 1; } if (moreusers && atoi(Pagenumber) < totalpages) { + if (bars) printf (" | "); printh ("<a href=\"%s&page=%d\">%s</a>", cgiurl("showusers"), atoi(Pagenumber)+1, html_text[137]); - printf (" | "); + bars = 1; } -/* printf (" | ");*/ #endif +#ifdef CATCHALL_ENABLED + if (bars) printf (" | "); printh ("<a href=\"%s\">%s</a>", cgiurl ("deleteall"), html_text[235]); printf (" | "); printh ("<a href=\"%s\">%s</a>", cgiurl ("bounceall"), html_text[134]); printf (" | "); printh ("<a href=\"%s\">%s</a>", cgiurl("setremotecatchall"), html_text[206]); +#endif printf (" ]"); printf ("</b></font>"); printf ("</td></tr>\n"); @@ -380,6 +386,15 @@ exit(0); } +#ifndef TRIVIAL_PASSWORD_ENABLED + if ( strstr(Newu,Password1)!=NULL) { + snprintf (StatusMessage, sizeof(StatusMessage), "%s\n", html_text[320]); + adduser(); + vclose(); + exit(0); + } +#endif + #ifndef ENABLE_LEARN_PASSWORDS if ( strlen(Password1) <= 0 ) { snprintf (StatusMessage, sizeof(StatusMessage), "%s\n", html_text[234]); @@ -773,6 +788,14 @@ vclose(); exit(0); } +#ifndef TRIVIAL_PASSWORD_ENABLED + if ( strstr(ActionUser,Password1)!=NULL) { + snprintf (StatusMessage, sizeof(StatusMessage), "%s\n", html_text[320]); + moduser(); + vclose(); + exit(0); + } +#endif ret_code = vpasswd( ActionUser, Domain, Password1, USE_POP); if ( ret_code != VA_SUCCESS ) { snprintf (StatusMessage, sizeof(StatusMessage), "%s (%s)", html_text[140], |