summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2014-04-18 23:29:39 +0000
committertron <tron@pkgsrc.org>2014-04-18 23:29:39 +0000
commit79c7992ba811bcc4f1de9e5225072e4b004402c4 (patch)
tree5939ef609366940aa9918019013c3fe31d0d9582
parent4f872f3c492f4d0683fdc162c15b4a66fa844ebb (diff)
downloadpkgsrc-79c7992ba811bcc4f1de9e5225072e4b004402c4.tar.gz
Add security patch from Samba GIT repository to address remote DoS
vulnerability in rsync's daemon mode (CVE-2014-2855).
-rw-r--r--net/rsync/Makefile3
-rw-r--r--net/rsync/distinfo3
-rw-r--r--net/rsync/patches/patch-authenticate.c77
3 files changed, 81 insertions, 2 deletions
diff --git a/net/rsync/Makefile b/net/rsync/Makefile
index 2fc4a7c03d3..e99a15a630c 100644
--- a/net/rsync/Makefile
+++ b/net/rsync/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.92 2014/03/11 14:34:39 jperkin Exp $
+# $NetBSD: Makefile,v 1.93 2014/04/18 23:29:39 tron Exp $
DISTNAME= rsync-3.1.0
+PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= http://rsync.samba.org/ftp/rsync/ \
http://rsync.samba.org/ftp/rsync/old-versions/ \
diff --git a/net/rsync/distinfo b/net/rsync/distinfo
index f85f274a10f..6415df0aa1e 100644
--- a/net/rsync/distinfo
+++ b/net/rsync/distinfo
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.38 2013/10/02 18:06:19 adam Exp $
+$NetBSD: distinfo,v 1.39 2014/04/18 23:29:39 tron Exp $
SHA1 (rsync-3.1.0.tar.gz) = eb58ab04bcb6293da76b83f58327c038b23fcba3
RMD160 (rsync-3.1.0.tar.gz) = d072ab02c31468aa72270a4cf90b5865c5139e1b
Size (rsync-3.1.0.tar.gz) = 883901 bytes
SHA1 (patch-ab) = 98aa07a50314e3309b48f803d6febb1138eae1f2
+SHA1 (patch-authenticate.c) = ef3d52e587053a3ee1cc4149f272bf2270319c60
diff --git a/net/rsync/patches/patch-authenticate.c b/net/rsync/patches/patch-authenticate.c
new file mode 100644
index 00000000000..b867b6795a7
--- /dev/null
+++ b/net/rsync/patches/patch-authenticate.c
@@ -0,0 +1,77 @@
+$NetBSD: patch-authenticate.c,v 1.1 2014/04/18 23:29:39 tron Exp $
+
+Close the remote DoS vulnerability reported in CVE-2014-2855.
+
+Patch taken from Samba GIT repository:
+
+https://git.samba.org/?p=rsync.git;a=commitdiff;h=0dedfbce2c1b851684ba658861fe9d620636c56a
+
+--- authenticate.c.orig 2013-06-09 20:11:53.000000000 +0100
++++ authenticate.c 2014-04-19 00:26:00.000000000 +0100
+@@ -102,15 +102,16 @@
+ char pass2[MAX_DIGEST_LEN*2];
+ const char *fname = lp_secrets_file(module);
+ STRUCT_STAT st;
+- int fd, ok = 1;
++ int ok = 1;
+ int user_len = strlen(user);
+ int group_len = group ? strlen(group) : 0;
+ char *err;
++ FILE *fh;
+
+- if (!fname || !*fname || (fd = open(fname, O_RDONLY)) < 0)
++ if (!fname || !*fname || (fh = fopen(fname, "r")) == NULL)
+ return "no secrets file";
+
+- if (do_fstat(fd, &st) == -1) {
++ if (do_fstat(fileno(fh), &st) == -1) {
+ rsyserr(FLOG, errno, "fstat(%s)", fname);
+ ok = 0;
+ } else if (lp_strict_modes(module)) {
+@@ -123,29 +124,30 @@
+ }
+ }
+ if (!ok) {
+- close(fd);
++ fclose(fh);
+ return "ignoring secrets file";
+ }
+
+ if (*user == '#') {
+ /* Reject attempt to match a comment. */
+- close(fd);
++ fclose(fh);
+ return "invalid username";
+ }
+
+ /* Try to find a line that starts with the user (or @group) name and a ':'. */
+ err = "secret not found";
+- while ((user || group) && read_line_old(fd, line, sizeof line, 1)) {
+- const char **ptr, *s;
++ while ((user || group) && fgets(line, sizeof line, fh) != NULL) {
++ const char **ptr, *s = strtok(line, "\n\r");
+ int len;
+- if (*line == '@') {
++ if (!s)
++ continue;
++ if (*s == '@') {
+ ptr = &group;
+ len = group_len;
+- s = line+1;
++ s++;
+ } else {
+ ptr = &user;
+ len = user_len;
+- s = line;
+ }
+ if (!*ptr || strncmp(s, *ptr, len) != 0 || s[len] != ':')
+ continue;
+@@ -158,7 +160,7 @@
+ *ptr = NULL; /* Don't look for name again. */
+ }
+
+- close(fd);
++ fclose(fh);
+
+ memset(line, 0, sizeof line);
+ memset(pass2, 0, sizeof pass2);