Author: ae
Date: Fri Aug 28 12:02:40 2015
New Revision: 287252
URL: https://svnweb.freebsd.org/changeset/base/287252

Log:
  MFC r286720:
    Use g_conf_printf_escaped() to escape illegal symbols in file name.
  
    PR:         202289

Modified:
  stable/9/sys/dev/md/md.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/md/md.c
==============================================================================
--- stable/9/sys/dev/md/md.c    Fri Aug 28 11:56:20 2015        (r287251)
+++ stable/9/sys/dev/md/md.c    Fri Aug 28 12:02:40 2015        (r287252)
@@ -88,6 +88,7 @@
 #include <sys/vnode.h>
 
 #include <geom/geom.h>
+#include <geom/geom_int.h>
 
 #include <vm/vm.h>
 #include <vm/vm_param.h>
@@ -1540,9 +1541,11 @@ g_md_dumpconf(struct sbuf *sb, const cha
                            indent, (uintmax_t) mp->mediasize);
                        sbuf_printf(sb, "%s<type>%s</type>\n", indent,
                            type);
-                       if (mp->type == MD_VNODE && mp->vnode != NULL)
-                               sbuf_printf(sb, "%s<file>%s</file>\n",
-                                   indent, mp->file);
+                       if (mp->type == MD_VNODE && mp->vnode != NULL) {
+                               sbuf_printf(sb, "%s<file>", indent);
+                               g_conf_printf_escaped(sb, "%s", mp->file);
+                               sbuf_printf(sb, "</file>\n");
+                       }
                }
        }
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to