Bug 202289

Summary: mdconfig -l outputs nothing if filename of vnode backed disk has unsafe characters
Product: Base System Reporter: Mansur Mamkin <mmamkin>
Component: kernAssignee: Andrey V. Elsukov <ae>
Status: Closed FIXED    
Severity: Affects Only Me CC: ae
Priority: ---    
Version: 10.1-RELEASE   
Hardware: Any   
OS: Any   

Description Mansur Mamkin 2015-08-13 12:29:25 UTC
"mdconfig -l" outputs nothing when there are vnode disks with '&' in filenames.
I suppose this occurs because g_md_dumpconf() doesn't escapse unsafe characters in filenames:
...
if (mp->type == MD_VNODE && mp->vnode != NULL)
            sbuf_printf(sb, "%s<file>%s</file>\n",
                indent, mp->file);
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-08-13 13:20:42 UTC
A commit references this bug:

Author: ae
Date: Thu Aug 13 13:20:30 UTC 2015
New revision: 286720
URL: https://svnweb.freebsd.org/changeset/base/286720

Log:
  Use g_conf_printf_escaped() to escape illegal symbols in file name.

  PR:		202289
  MFC after:	1 week

Changes:
  head/sys/dev/md/md.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-08-28 11:56:44 UTC
A commit references this bug:

Author: ae
Date: Fri Aug 28 11:56:21 UTC 2015
New revision: 287251
URL: https://svnweb.freebsd.org/changeset/base/287251

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

    PR:		202289

Changes:
_U  stable/10/
  stable/10/sys/dev/md/md.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-08-28 12:02:46 UTC
A commit references this bug:

Author: ae
Date: Fri Aug 28 12:02:41 UTC 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

Changes:
_U  stable/9/sys/
_U  stable/9/sys/dev/
  stable/9/sys/dev/md/md.c
Comment 4 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-08-28 12:03:33 UTC
Fixed in head/, stable/10 and stable/9. Thanks!