Skip to content

Commit

Permalink
updated vsetuserquota
Browse files Browse the repository at this point in the history
1. vsetuserquota.c: print current usage in bytes on stdout
2. setuserquota.c: changed return type of setuserquota to 64bit int
  • Loading branch information
mbhangui committed May 24, 2024
1 parent 9f52b42 commit 11a3441
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
3 changes: 3 additions & 0 deletions indimail-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Release @version@-@release@ Start 02/05/2024 End XX/XX/XXXX
11. adminclient.c, indisrvr.c: added paranoid check for command mismatch
12. checkPerm.c: added feature to match command line args using
regex/wildmatch
- 24/05/2024
13. vsetuserquota.c: print current usage in bytes on stdout
14. setuserquota.c: changed return type of setuserquota to 64bit int

* 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
7 changes: 5 additions & 2 deletions indimail-x/setuserquota.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: setuserquota.c,v $
* Revision 1.5 2024-05-24 14:48:06+05:30 Cprogrammer
* changed return type of setuserquota to 64bit int
*
* Revision 1.4 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
Expand Down Expand Up @@ -36,7 +39,7 @@
#include "sql_setquota.h"

#ifndef lint
static char sccsid[] = "$Id: setuserquota.c,v 1.4 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
static char sccsid[] = "$Id: setuserquota.c,v 1.5 2024-05-24 14:48:06+05:30 Cprogrammer Exp mbhangui $";
#endif

static void
Expand All @@ -47,7 +50,7 @@ die_nomem()
}

/*- Update a users quota */
int
mdir_t
setuserquota(const char *username, const char *domain, const char *quota)
{
const char *domain_ptr;
Expand Down
6 changes: 5 additions & 1 deletion indimail-x/setuserquota.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: setuserquota.h,v $
* Revision 1.3 2024-05-24 14:48:31+05:30 Cprogrammer
* changed return type of setuserquota to 64bit int
*
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
Expand All @@ -9,7 +12,8 @@
*/
#ifndef SETUSERQUOTA_H
#define SETUSERQUOTA_H
#include <indimail.h>

int setuserquota(const char *, const char *, const char *);
mdir_t setuserquota(const char *, const char *, const char *);

#endif /*- SETUSERQUOTA_H */
13 changes: 10 additions & 3 deletions indimail-x/vsetuserquota.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: vsetuserquota.c,v $
* Revision 1.5 2024-05-24 14:52:01+05:30 Cprogrammer
* print current usage in bytes on stdout
*
* Revision 1.4 2024-05-17 16:24:31+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
Expand Down Expand Up @@ -33,6 +36,8 @@
#include <strerr.h>
#include <env.h>
#include <sgetopt.h>
#include <qprintf.h>
#include <subfd.h>
#endif
#include "get_indimailuidgid.h"
#include "parse_email.h"
Expand All @@ -48,7 +53,7 @@
#include "setuserquota.h"

#ifndef lint
static char sccsid[] = "$Id: vsetuserquota.c,v 1.4 2024-05-17 16:24:31+05:30 mbhangui Exp mbhangui $";
static char sccsid[] = "$Id: vsetuserquota.c,v 1.5 2024-05-24 14:52:01+05:30 Cprogrammer Exp mbhangui $";
#endif

#define FATAL "vsetuserquota: fatal: "
Expand Down Expand Up @@ -105,7 +110,7 @@ die_nomem()
int
main(int argc, char **argv)
{
int i;
mdir_t i;
uid_t uid;
gid_t gid;
char *email, *quota;
Expand Down Expand Up @@ -178,5 +183,7 @@ main(int argc, char **argv)
#endif
i = setuserquota(User.s, real_domain, quota);
iclose();
return (i);
subprintf(subfdout, "usage %ld bytes\n", i);
substdio_flush(subfdout);
return (i < 0 ? 1 : 0);
}

0 comments on commit 11a3441

Please sign in to comment.