Deleted Added
full compact
kern_conf.c (239791) kern_conf.c (244584)
1/*-
2 * Copyright (c) 1999-2002 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999-2002 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/kern/kern_conf.c 239791 2012-08-28 19:30:29Z ed $");
28__FBSDID("$FreeBSD: head/sys/kern/kern_conf.c 244584 2012-12-22 13:33:28Z jh $");
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/bio.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 656 unchanged lines hidden (view full) ---

693 if (len > sizeof(dev->si_name) - 1)
694 return (ENAMETOOLONG);
695
696 /* Strip leading slashes. */
697 for (from = dev->si_name; *from == '/'; from++)
698 ;
699
700 for (to = dev->si_name; *from != '\0'; from++, to++) {
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/bio.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 656 unchanged lines hidden (view full) ---

693 if (len > sizeof(dev->si_name) - 1)
694 return (ENAMETOOLONG);
695
696 /* Strip leading slashes. */
697 for (from = dev->si_name; *from == '/'; from++)
698 ;
699
700 for (to = dev->si_name; *from != '\0'; from++, to++) {
701 /*
702 * Spaces and double quotation marks cause
703 * problems for the devctl(4) protocol.
704 * Reject names containing those characters.
705 */
706 if (isspace(*from) || *from == '"')
707 return (EINVAL);
701 /* Treat multiple sequential slashes as single. */
702 while (from[0] == '/' && from[1] == '/')
703 from++;
704 /* Trailing slash is considered invalid. */
705 if (from[0] == '/' && from[1] == '\0')
706 return (EINVAL);
707 *to = *from;
708 }

--- 744 unchanged lines hidden ---
708 /* Treat multiple sequential slashes as single. */
709 while (from[0] == '/' && from[1] == '/')
710 from++;
711 /* Trailing slash is considered invalid. */
712 if (from[0] == '/' && from[1] == '\0')
713 return (EINVAL);
714 *to = *from;
715 }

--- 744 unchanged lines hidden ---