summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2015-01-17 16:22:23 -0800
committerPalmer Dabbelt <palmer@dabbelt.com>2015-01-17 16:22:23 -0800
commitba596245f5b606e30c651ffea62d3e5aba2bd84a (patch)
tree94ed9d5705594b28bf758edee5266781e619f0b6
parentAdd a GTK2 port of media-sound/pavucontrol at 1.0 and 2.0 (diff)
downloadpalmer-ba596245f5b606e30c651ffea62d3e5aba2bd84a.tar.gz
palmer-ba596245f5b606e30c651ffea62d3e5aba2bd84a.tar.bz2
palmer-ba596245f5b606e30c651ffea62d3e5aba2bd84a.zip
Add mail-client/mhng at 0.0.2
MHng is a rewrite of NMH that's designed to be compatible with the latest mail enviornments (like IMAP and SMTP).
-rw-r--r--mail-client/mhng/Manifest5
-rw-r--r--mail-client/mhng/files/mhng-0.0.2-fgets_return.patch37
-rw-r--r--mail-client/mhng/files/mhng-0.0.2-system_return.patch25
-rw-r--r--mail-client/mhng/files/mhng-0.0.2-write_return.patch25
-rw-r--r--mail-client/mhng/mhng-0.0.2.ebuild39
5 files changed, 131 insertions, 0 deletions
diff --git a/mail-client/mhng/Manifest b/mail-client/mhng/Manifest
new file mode 100644
index 0000000..5c89906
--- /dev/null
+++ b/mail-client/mhng/Manifest
@@ -0,0 +1,5 @@
+AUX mhng-0.0.2-fgets_return.patch 1142 SHA256 3152dbc62163df3b8b2877d30a0dec8eaba3c155652de9c72b35a46d491d26e2 SHA512 cded8b4467c228d9c36a19c4be0458c8145672b02e75597d6df01e7465e9d0d09828ac1f9ea037eea87ea90c03634462a1cccd1fbac5829924683a92c5f45320 WHIRLPOOL 527d7364c1eaf5ef0addd0d625cc561d2e55a200ab9fadf84483e651421c1c65e33850865e6125b7d3f9e1be117f0891fcb347e2cfb5361244b6dfe9758fb76b
+AUX mhng-0.0.2-system_return.patch 856 SHA256 58e3fcdf6ead837291775c9f3b3deb21af9a0733a0516469fa3bbeb72e4f5020 SHA512 43b65f3e174d59163942ed35ca1b0b2998a047d82ea12938da9c5587e2ff070d473f93054ed045eac42140dd7ff8b6f60ba3347cd125a1d1c303ba018ab58b4e WHIRLPOOL ea6bcfd4f8cc6710c12cac6f41fc36cee3289c818e39f503504a09dd634c901624edc719b4c2a4178063ec3d2b9ebe5376b33799d5408c27dcaad0ea71ef74a5
+AUX mhng-0.0.2-write_return.patch 769 SHA256 aedf6bdfe792fd3cc57792b76871b83e5ad707c88f7295f5c176e53f201f6410 SHA512 a46869052404f733bdd820e13b75c57c08dea0871ac82240eaf0b2d409cfefabe51cc809a6d9b0ba1d6aa7fbe0342181e031f53919aeb60159850f790b661bc4 WHIRLPOOL 6ba30fff5d013fd3a27d1af2f6258f9c2069e8570ba31dcc56844b7f010f5ac8ebf1eb7a72e6614ae706c02869f3a3f962c7171c30667fd1e543defab1e3c8b7
+DIST mhng-0.0.2.tar.gz 73502 SHA256 c50490cce79d1b432b6990535cca9e45f46509015f7755f158c9db9f467ac748 SHA512 b677aea5a04d46570d3f49ab936da398aee9fdb8965d1a260055c1b6e317645bd0ff2b27a5f2647efe3e7d2ac64ac2555e9151d240d548434e0a6056158a9669 WHIRLPOOL 426c42199cd91cc19cba7db2de3818bfb4d8d974658634ad18a87aa6ce43abca095499953d5b16e341a96cc4acd737ca7d9319ffffef468ab3ab71633e354cbf
+EBUILD mhng-0.0.2.ebuild 927 SHA256 65235d06fc2fd4fd8eecae75ac02f0368b7ed8b6dcfcbd13eaa9cb0deaf22259 SHA512 64b10b877730b33f18b72977eeea0a2096e9de6cc5b231baa8cead2c763a2829640f3e850246e3669fffb3b0c41a36f4f1f41cd53287ba357d73aca3aa6e5cc1 WHIRLPOOL 3fc68c4e1fa78fd72e75c5a7b383e5dba867769eaae1b2cb3ffcdbcafab537ae8037d66315cda1e83777c8df312b7a164141edee30162d53c6c3264a426cdf74
diff --git a/mail-client/mhng/files/mhng-0.0.2-fgets_return.patch b/mail-client/mhng/files/mhng-0.0.2-fgets_return.patch
new file mode 100644
index 0000000..d1b4d8c
--- /dev/null
+++ b/mail-client/mhng/files/mhng-0.0.2-fgets_return.patch
@@ -0,0 +1,37 @@
+commit d1d5f1c46aebf480af7c46d64b3fc0f75814946d
+Author: Palmer Dabbelt <palmer@dabbelt.com>
+Date: Fri Dec 5 15:47:25 2014 -0800
+
+ Check that the username/password files aren't empty
+
+ This would have caused a bit of undefined behavior due to some
+ uninitialized stack buffers.
+
+diff --git a/src/libmhng/mailbox.c++ b/src/libmhng/mailbox.c++
+index a21f9ab..794a74b 100644
+--- a/src/libmhng/mailbox.c++
++++ b/src/libmhng/mailbox.c++
+@@ -195,7 +195,10 @@ std::string mailbox::username(void) const
+ }
+
+ char line[BUFFER_SIZE];
+- fgets(line, BUFFER_SIZE, file);
++ if (fgets(line, BUFFER_SIZE, file) == NULL) {
++ fprintf(stderr, "Empty username file\n");
++ abort();
++ }
+ while (isspace(line[strlen(line)-1]))
+ line[strlen(line)-1] = '\0';
+
+@@ -218,7 +221,10 @@ std::string mailbox::password(void) const
+ }
+
+ char line[BUFFER_SIZE];
+- fgets(line, BUFFER_SIZE, file);
++ if (fgets(line, BUFFER_SIZE, file) == NULL) {
++ fprintf(stderr, "Empty password file\n");
++ abort();
++ }
+ while (isspace(line[strlen(line)-1]))
+ line[strlen(line)-1] = '\0';
+
diff --git a/mail-client/mhng/files/mhng-0.0.2-system_return.patch b/mail-client/mhng/files/mhng-0.0.2-system_return.patch
new file mode 100644
index 0000000..d140e33
--- /dev/null
+++ b/mail-client/mhng/files/mhng-0.0.2-system_return.patch
@@ -0,0 +1,25 @@
+commit 1f34560136cfec61b56cc069ac5516510d292902
+Author: Palmer Dabbelt <palmer@dabbelt.com>
+Date: Fri Dec 5 15:50:00 2014 -0800
+
+ Check the return code of system() in mhng-urls
+
+ This isn't so interesting because we're just opening a web browser,
+ but I guess it's a tiny bit safer -- note that all I do here is print
+ a stderr message...
+
+diff --git a/src/mhng-urls.c++ b/src/mhng-urls.c++
+index a809e76..c364512 100644
+--- a/src/mhng-urls.c++
++++ b/src/mhng-urls.c++
+@@ -70,7 +70,9 @@ int main(int argc, const char **argv)
+ getenv("BROWSER"),
+ url.c_str()
+ );
+- system(command);
++ if (system(command) != 0)
++ fprintf(stderr, "command '%s' failed\n",
++ command);
+ }
+ }
+ if (args->numbers().size() != 0)
diff --git a/mail-client/mhng/files/mhng-0.0.2-write_return.patch b/mail-client/mhng/files/mhng-0.0.2-write_return.patch
new file mode 100644
index 0000000..9e06ea5
--- /dev/null
+++ b/mail-client/mhng/files/mhng-0.0.2-write_return.patch
@@ -0,0 +1,25 @@
+commit 012e86cc6f1744c6e712737a496abfdb62786433
+Author: Palmer Dabbelt <palmer@dabbelt.com>
+Date: Fri Dec 5 15:45:19 2014 -0800
+
+ Always check write()'s return value
+
+ Even if a write() of 1 can't fail here, I guess I still need to check
+ it...
+
+diff --git a/src/libmhng/mime/part.c++ b/src/libmhng/mime/part.c++
+index 268dfa5..4dfbc45 100644
+--- a/src/libmhng/mime/part.c++
++++ b/src/libmhng/mime/part.c++
+@@ -316,7 +316,10 @@ std::vector<std::string> mime::part::utf8(void) const
+ written += wout;
+ }
+
+- ::write(outfd, "\n", 1);
++ if (::write(outfd, "\n", 1) != 1) {
++ fprintf(stderr, "write of 1 failed\n");
++ abort();
++ }
+ }
+
+ close(outfd);
diff --git a/mail-client/mhng/mhng-0.0.2.ebuild b/mail-client/mhng/mhng-0.0.2.ebuild
new file mode 100644
index 0000000..40503ce
--- /dev/null
+++ b/mail-client/mhng/mhng-0.0.2.ebuild
@@ -0,0 +1,39 @@
+EAPI="4"
+inherit eutils
+
+DESCRIPTION="A modern MH clone"
+HOMEPAGE="http://www.dabbelt.com/~palmer/software/mhng/"
+SRC_URI="https://github.com/palmer-dabbelt/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 amd64-linux"
+IUSE=""
+
+RDEPEND="app-crypt/gpgme
+ dev-db/sqlite
+ dev-libs/gitdate
+ net-libs/gnutls
+ sys-apps/util-linux
+ sys-libs/ncurses
+ www-client/lynx
+ "
+
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-write_return.patch"
+ epatch "${FILESDIR}/${P}-fgets_return.patch"
+ epatch "${FILESDIR}/${P}-system_return.patch"
+}
+
+src_configure() {
+ echo "LANGUAGES += c++" >> Configfile.local
+ for i in $(echo ${CFLAGS}); do
+ echo "COMPILEOPTS += ${i}" >> Configfile.local
+ done
+ echo "COMPILEOPTS += -DPBASHC_SHEBANG=\\\"\#\!${EPREFIX}/bin/bash\\\""\
+ >> Configfile.local
+
+ pconfigure
+}