summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-mail/qmailadmin/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-mail/qmailadmin/files')
-rw-r--r--net-mail/qmailadmin/files/qmailadmin-1.2.12-quota-overflow.patch118
-rw-r--r--net-mail/qmailadmin/files/qmailadmin-1.2.15-quota-security.patch41
-rw-r--r--net-mail/qmailadmin/files/qmailadmin-1.2.9-maildir.patch11
3 files changed, 170 insertions, 0 deletions
diff --git a/net-mail/qmailadmin/files/qmailadmin-1.2.12-quota-overflow.patch b/net-mail/qmailadmin/files/qmailadmin-1.2.12-quota-overflow.patch
new file mode 100644
index 000000000000..b4c5aa90248a
--- /dev/null
+++ b/net-mail/qmailadmin/files/qmailadmin-1.2.12-quota-overflow.patch
@@ -0,0 +1,118 @@
+diff -Nurp qmailadmin-1.2.12/util.c qmailadmin-1.2.12.new/util.c
+--- qmailadmin-1.2.12/util.c 2007-09-21 19:27:40.000000000 -0400
++++ qmailadmin-1.2.12.new/util.c 2009-07-11 01:54:02.000000000 -0400
+@@ -19,10 +19,11 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <stddef.h>
++#include <errno.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
+-#include <unistd.h>
+ #include <pwd.h>
+ #include <dirent.h>
+ #include <ctype.h>
+@@ -352,41 +353,70 @@ char *get_quota_used(char *dir) {
+ back to bytes for vpasswd file
+ return value: 0 for success, 1 for failure
+ */
+-int quota_to_bytes(char returnval[], char *quota) {
++int quota_to_bytes(char returnval[], const char *quota) {
+ double tmp;
++ int err = 0;
+
+ if (quota == NULL) { return 1; }
+- if ((tmp = atof(quota))) {
+- tmp *= 1048576;
+- sprintf(returnval, "%.0lf", tmp);
+- return 0;
++
++ /* first set errno to 0 to determine if an error occurs */
++ errno = 0;
++ tmp = strtod(quota, NULL);
++ err = errno;
++ if (err != 0) {
++ perror("quota_to_bytes");
++ return 1;
+ } else {
+- strcpy (returnval, "");
+- return 1;
++ tmp *= (1024*1024);
++ err = sprintf(returnval, "%.0lf", tmp);
++ if (err > 0) {
++ return 0;
++ } else {
++ returnval[0] = '\0';
++ return 1;
++ }
+ }
+ }
+ /* quota_to_megabytes: used to convert vpasswd representation of quota
+ to number of megabytes.
+ return value: 0 for success, 1 for failure
+ */
+-int quota_to_megabytes(char *returnval, char *quota) {
++int quota_to_megabytes(char *returnval, const char *quota) {
+ double tmp;
+- int i;
++ int err = 0;
++ size_t i;
+
+ if (quota == NULL) { return 1; }
+ i = strlen(quota);
++
++ errno = 0;
++ tmp = strtod(quota, NULL);
++ err = errno;
++ if (err != 0) {
++ perror("quota_to_megabytes");
++ return 1;
++ }
++
+ if ((quota[i-1] == 'M') || (quota[i-1] == 'm')) {
+- tmp = atol(quota); /* already in megabytes */
++ /* already in megabytes */
+ } else if ((quota[i-1] == 'K') || (quota[i-1] == 'k')) {
+- tmp = atol(quota) * 1024; /* convert kilobytes to megabytes */
+- } else if ((tmp = atol(quota))) {
+- tmp /= 1048576.0;
++ /* convert kilobytes to megabytes */
++ tmp *= 1024;
++ } else if (tmp != 0) {
++ /* convert bytes to megabytes */
++ tmp /= (1024*1024);
+ } else {
+- strcpy (returnval, "");
+- return 1;
++ returnval[0] = '\0';
++ return 1;
++ }
++
++ err = sprintf(returnval, "%.2lf", tmp);
++ if (err > 0) {
++ return 0;
++ } else {
++ returnval[0] = '\0';
++ return 1;
+ }
+- sprintf(returnval, "%.2lf", tmp);
+- return 0;
+ }
+
+ void print_user_index (char *action, int colspan, char *user, char *dom, time_t mytime)
+diff -Nurp qmailadmin-1.2.12/util.h qmailadmin-1.2.12.new/util.h
+--- qmailadmin-1.2.12/util.h 2007-09-21 19:27:40.000000000 -0400
++++ qmailadmin-1.2.12.new/util.h 2009-07-11 02:02:45.000000000 -0400
+@@ -25,8 +25,8 @@ void str_replace (char *, char, char);
+
+ void qmail_button(char *modu, char *command, char *user, char *dom, time_t mytime, char *png);
+
+-int quota_to_bytes(char[], char*); //jhopper prototype
+-int quota_to_megabytes(char[], char*); //jhopper prototype
++int quota_to_bytes(char[], const char*); //jhopper prototype
++int quota_to_megabytes(char[], const char*); //jhopper prototype
+
+ void print_user_index (char *action, int colspan, char *user, char *dom, time_t mytime);
+ char *cgiurl (char *action);
diff --git a/net-mail/qmailadmin/files/qmailadmin-1.2.15-quota-security.patch b/net-mail/qmailadmin/files/qmailadmin-1.2.15-quota-security.patch
new file mode 100644
index 000000000000..bf8ca4785dfd
--- /dev/null
+++ b/net-mail/qmailadmin/files/qmailadmin-1.2.15-quota-security.patch
@@ -0,0 +1,41 @@
+Previous patch did not fix the 32-bit overflow properly.
+This goes with the vpopmail 5.4.33 matching quota fix (in upstream).
+
+X-Gentoo-Bug: 269129
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar qmailadmin-1.2.15.orig/qmailadmin.h qmailadmin-1.2.15/qmailadmin.h
+--- qmailadmin-1.2.15.orig/qmailadmin.h 2013-05-30 23:42:27.689759997 +0000
++++ qmailadmin-1.2.15/qmailadmin.h 2013-05-30 23:44:33.870866242 +0000
+@@ -63,4 +63,4 @@
+ /* copied from maildirquota.c in vpopmail
+ * it really needs to get into vpopmail.h somehow
+ */
+-int readuserquota(const char* dir, long *sizep, int *cntp);
++//int readuserquota(const char* dir, storage_t *sizep, storage_t *cntp);
+diff -Nuar qmailadmin-1.2.15.orig/template.c qmailadmin-1.2.15/template.c
+--- qmailadmin-1.2.15.orig/template.c 2009-02-06 05:30:05.000000000 +0000
++++ qmailadmin-1.2.15/template.c 2013-05-30 23:45:47.319571080 +0000
+@@ -426,7 +426,7 @@
+ case 'Q':
+ vpw = vauth_getpw(ActionUser, Domain);
+ if (strncmp(vpw->pw_shell, "NOQUOTA", 2) != 0) {
+- long diskquota = 0;
+- int maxmsg = 0;
++ uint64_t diskquota = 0;
++ uint64_t maxmsg = 0;
+ char path[256];
+
+diff -Nuar qmailadmin-1.2.15.orig/user.c qmailadmin-1.2.15/user.c
+--- qmailadmin-1.2.15.orig/user.c 2009-05-02 19:13:29.000000000 +0000
++++ qmailadmin-1.2.15/user.c 2013-05-30 23:45:26.039946212 +0000
+@@ -170,7 +170,7 @@
+ (AdminType==USER_ADMIN && strcmp(pw->pw_name,Username)==0)))) {
+ if (AdminType==DOMAIN_ADMIN ||
+ (AdminType==USER_ADMIN && strcmp(pw->pw_name,Username)==0)) {
+- long diskquota = 0;
+- int maxmsg = 0;
++ uint64_t diskquota = 0;
++ uint64_t maxmsg = 0;
+
+ /* display account name and user name */
diff --git a/net-mail/qmailadmin/files/qmailadmin-1.2.9-maildir.patch b/net-mail/qmailadmin/files/qmailadmin-1.2.9-maildir.patch
new file mode 100644
index 000000000000..e2a8f49a5c1b
--- /dev/null
+++ b/net-mail/qmailadmin/files/qmailadmin-1.2.9-maildir.patch
@@ -0,0 +1,11 @@
+--- qmailadmin-1.2.9/qmailadmin.h
++++ qmailadmin-1.2.9/qmailadmin.h
+@@ -24,7 +24,7 @@
+ * it below.
+ */
+ #ifndef MAILDIR
+-#define MAILDIR "Maildir"
++#define MAILDIR ".maildir"
+ #endif
+
+ /* max # of forwards a user can set on the Modify User screen */