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

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