Blame SOURCES/autofs-5.0.8-check-for-bind-onto-self-in-mount_bind-c.patch

306fa1
autofs-5.0.8 - check for bind onto self in mount_bind.c
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
Check for an obviously impossible request to bind or symlink to the
306fa1
same patch for source and target.
306fa1
---
306fa1
 CHANGELOG            |    1 +
306fa1
 modules/mount_bind.c |    6 ++++++
306fa1
 2 files changed, 7 insertions(+)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -85,6 +85,7 @@
306fa1
 - fix compilation of lookup_ldap.c without sasl.
306fa1
 - fix undefined authtype_requires_creds err if ldap enabled but without sasl.
306fa1
 - pass map_source as function paramter where possible.
306fa1
+- check for bind onto self in mount_bind.c.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/modules/mount_bind.c
306fa1
+++ autofs-5.0.7/modules/mount_bind.c
306fa1
@@ -135,6 +135,12 @@ int mount_mount(struct autofs_point *ap,
306fa1
 	if (options == NULL || *options == '\0')
306fa1
 		options = "defaults";
306fa1
 
306fa1
+	if (!strcmp(what, fullpath)) {
306fa1
+		debug(ap->logopt, MODPREFIX
306fa1
+		     "cannot mount or symlink %s to itself", fullpath);
306fa1
+		return 1;
306fa1
+	}
306fa1
+
306fa1
 	if (!symlnk && bind_works) {
306fa1
 		int status, existed = 1;
306fa1