Bug 202289 - mdconfig -l outputs nothing if filename of vnode backed disk has unsafe characters
Summary: mdconfig -l outputs nothing if filename of vnode backed disk has unsafe chara...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Andrey V. Elsukov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-13 12:29 UTC by Mansur Mamkin
Modified: 2015-08-28 12:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!