From de8a1071d5920bcdea674f08250851affe15dc4f Mon Sep 17 00:00:00 2001 From: jh Date: Sat, 22 Dec 2012 13:33:28 +0000 Subject: Reject spaces and double quotation marks in device names. devctl(4) and devd(8) can't handle names with such characters properly. PR: bin/144736, kern/161912 Discussed with: imp, kib, pjd --- sys/kern/kern_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/kern/kern_conf.c') diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 288fac5..c04d1da 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -698,6 +698,13 @@ prep_devname(struct cdev *dev, const char *fmt, va_list ap) ; for (to = dev->si_name; *from != '\0'; from++, to++) { + /* + * Spaces and double quotation marks cause + * problems for the devctl(4) protocol. + * Reject names containing those characters. + */ + if (isspace(*from) || *from == '"') + return (EINVAL); /* Treat multiple sequential slashes as single. */ while (from[0] == '/' && from[1] == '/') from++; -- cgit v1.1