|
Lines 2042-2047
kern_kmq_open(struct thread *td, const char *upath, int flags, mode_t mode,
Link Here
|
| 2042 |
len = strlen(path); |
2042 |
len = strlen(path); |
| 2043 |
if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) |
2043 |
if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) |
| 2044 |
return (EINVAL); |
2044 |
return (EINVAL); |
|
|
2045 |
/* "." and ".." are directories and cannot be opened as queues */ |
| 2046 |
if (!strcmp(path, "/.") || !strcmp(path, "/..")) |
| 2047 |
return (EINVAL); |
| 2045 |
AUDIT_ARG_UPATH1_CANON(path); |
2048 |
AUDIT_ARG_UPATH1_CANON(path); |
| 2046 |
|
2049 |
|
| 2047 |
error = falloc(td, &fp, &fd, O_CLOEXEC); |
2050 |
error = falloc(td, &fp, &fd, O_CLOEXEC); |
|
Lines 2142-2147
sys_kmq_unlink(struct thread *td, struct kmq_unlink_args *uap)
Link Here
|
| 2142 |
len = strlen(path); |
2145 |
len = strlen(path); |
| 2143 |
if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) |
2146 |
if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) |
| 2144 |
return (EINVAL); |
2147 |
return (EINVAL); |
|
|
2148 |
if (!strcmp(path, "/.") || !strcmp(path, "/..")) |
| 2149 |
return (EINVAL); |
| 2145 |
AUDIT_ARG_UPATH1_CANON(path); |
2150 |
AUDIT_ARG_UPATH1_CANON(path); |
| 2146 |
|
2151 |
|
| 2147 |
sx_xlock(&mqfs_data.mi_lock); |
2152 |
sx_xlock(&mqfs_data.mi_lock); |