[BACK]Return to patch-ax CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / net / samba33 / patches

File: [cvs.NetBSD.org] / pkgsrc / net / samba33 / patches / Attic / patch-ax (download)

Revision 1.1.1.1 (vendor branch), Tue Feb 16 16:24:16 2010 UTC (12 years, 11 months ago) by taca
Branch: TNF
CVS Tags: pkgsrc-base, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1
Changes since 1.1: +0 -0 lines

Importing Samba 3.3.10 as net/samba33.
This isn't latest release, but diffrence from current package is minimal
supported release.

Since changes are too huge to write here, please refer each release notes:

	http://www.samba.org/samba/history/

And this pacakge already contain fix for CVE-2009-3297.



$NetBSD: patch-ax,v 1.1.1.1 2010/02/16 16:24:16 taca Exp $

Fix for CVE-2009-3297.

--- client/mount.cifs.c.orig	2010-01-14 10:12:10.000000000 +0000
+++ client/mount.cifs.c
@@ -1044,6 +1044,35 @@ static void print_cifs_mount_version(voi
 		MOUNT_CIFS_VENDOR_SUFFIX);
 }
 
+/*
+ * This function borrowed from fuse-utils...
+ *
+ * glibc's addmntent (at least as of 2.10 or so) doesn't properly encode
+ * newlines embedded within the text fields. To make sure no one corrupts
+ * the mtab, fail the mount if there are embedded newlines.
+ */
+static int check_newline(const char *progname, const char *name)
+{
+    char *s;
+    for (s = "\n"; *s; s++) {
+	if (strchr(name, *s)) {
+	    fprintf(stderr, "%s: illegal character 0x%02x in mount entry\n",
+		    progname, *s);
+	    return EX_USAGE;
+	}
+    }
+    return 0;
+}
+
+static int check_mtab(const char *progname, const char *devname,
+		      const char *dir)
+{
+	if (check_newline(progname, devname) == -1 ||
+	    check_newline(progname, dir) == -1)
+		return EX_USAGE;
+	return 0;
+}
+
 int main(int argc, char ** argv)
 {
 	int c;
@@ -1464,6 +1493,10 @@ mount_retry:
 	if (verboseflag)
 		fprintf(stderr, "\n");
 
+	rc = check_mtab(thisprogram, dev_name, mountpoint);
+	if (rc)
+		goto mount_exit;
+
 	if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
 		switch (errno) {
 		case ECONNREFUSED: