Skip to content

Commit

Permalink
password change bug fix, vlimit, print_limits modification
Browse files Browse the repository at this point in the history
1. sql_passwd.c: BUG: fixed wrong condition for sql query
2. ipasswd.c: fixed typo
3. vlimit.c: refactored code
4. print_limits.c: bug fix
  • Loading branch information
mbhangui committed May 30, 2024
1 parent 4dab93e commit fe5b285
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 93 deletions.
4 changes: 4 additions & 0 deletions indimail-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Release @version@-@release@ Start 02/05/2024 End XX/XX/XXXX
- 29/05/2024
35. iadddomain.c, vmoddomain.c: fixed perms for .qmail-default,
.domain_limits, hash_method
- 30/05/2024
36. sql_passwd.c: BUG: fixed wrong condition for sql query
37. ipasswd.c: fixed typo
38. vlimit.c: refactored code

* Mon Jan 01 2024 09:24:41 +0000 Manvendra Bhangui <indimail-virtualdomains@indimail.org> 3.4.6-1.1%{?dist}
Release 3.4.6-1.1 Start 09/09/2023 End 01/01/2024
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/ipasswd.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ipasswd(const char *username, const char *domain, const char *password, int encr
if (!(pw = sql_getpw(username, domain)))
return (0);
if (pw->pw_gid & NO_PASSWD_CHNG) {
strerr_warn1("ipasswd: User not allowed to change passwd", 0);
strerr_warn1("ipasswd: User not allowed to change password", 0);
return (-1);
}
if (!(ptr = env_get("PASSWORD_HASH"))) {
Expand Down
14 changes: 9 additions & 5 deletions indimail-x/print_limits.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* $Id: $
* $Id: print_limits.c,v 1.1 2024-05-30 22:11:19+05:30 Cprogrammer Exp mbhangui $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifndef lint
static char rcsid[] = "$Id: $";
static char rcsid[] = "$Id: print_limits.c,v 1.1 2024-05-30 22:11:19+05:30 Cprogrammer Exp mbhangui $";
#endif

#ifdef HAVE_QMAIL
Expand All @@ -20,7 +20,7 @@ static char rcsid[] = "$Id: $";
void
print_limits(struct vlimits *lmt)
{
if (lmt->limit_type == 1) {
if (lmt->limit_type == 1 || lmt->limit_type == 2) {
subprintfe(subfdout, "vlimits", "Domain Expiry Date : %s",
lmt->domain_expiry == -1 ? "Never Expires\n" : ctime(&lmt->domain_expiry));
subprintfe(subfdout, "vlimits", "Password Expiry Date : %s",
Expand Down Expand Up @@ -70,7 +70,8 @@ print_limits(struct vlimits *lmt)
subprintfe(subfdout, "vlimits", " %s\n", lmt->disable_pop ? "NO_POP" : "POP3");
subprintfe(subfdout, "vlimits", " %s\n", lmt->disable_webmail ? "NO_WEBMAIL" : "WEBMAIL");
subprintfe(subfdout, "vlimits", " %s\n", lmt->disable_relay ? "NO_RELAY" : "RELAY");
} else {
}
if (lmt->limit_type == 2) {
subprintfe(subfdout, "vlimits", "Flags for non postmaster accounts:\n");
subprintfe(subfdout, "vlimits", " pop account : %12s %12s %12s\n",
lmt->perm_account & VLIMIT_DISABLE_CREATE ? "DENY_CREATE" : "ALLOW_CREATE",
Expand Down Expand Up @@ -113,5 +114,8 @@ print_limits(struct vlimits *lmt)
}

/*
* $Log: $
* $Log: print_limits.c,v $
* Revision 1.1 2024-05-30 22:11:19+05:30 Cprogrammer
* Initial revision
*
*/
10 changes: 6 additions & 4 deletions indimail-x/sql_passwd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: sql_passwd.c,v $
* Revision 1.6 2024-05-30 22:08:20+05:30 Cprogrammer
* BUG: fixed wrong condition for sql query
*
* Revision 1.5 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
Expand Down Expand Up @@ -36,7 +39,7 @@
#include "sql_getpw.h"

#ifndef lint
static char sccsid[] = "$Id: sql_passwd.c,v 1.5 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
static char sccsid[] = "$Id: sql_passwd.c,v 1.6 2024-05-30 22:08:20+05:30 Cprogrammer Exp mbhangui $";
#endif

static void
Expand Down Expand Up @@ -69,11 +72,10 @@ do_sql(const char *user, const char *domain, const char *pass, const char *scram
!stralloc_cats(&SqlBuf, user) ||
!stralloc_append(&SqlBuf, "\""))
die_nomem();
if (!stralloc_0(&SqlBuf))
die_nomem();
if (site_size == SMALL_SITE) {
if (!stralloc_catb(&SqlBuf, " and pw_domain = \"", 18) ||
!stralloc_cats(&SqlBuf, domain))
!stralloc_cats(&SqlBuf, domain) ||
!stralloc_append(&SqlBuf, "\""))
die_nomem();
}
if (!stralloc_0(&SqlBuf))
Expand Down
1 change: 1 addition & 0 deletions indimail-x/vlimit.1
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ set default quota flags
.PP
.TP 2
perm_flags:
0 - clear all flags
a - set deny all flag
c - set deny create flag
m - set deny modify flag
Expand Down
Loading

0 comments on commit fe5b285

Please sign in to comment.