Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_file.c
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) | ||||
* checking below. | * checking below. | ||||
*/ | */ | ||||
fd = td->td_retval[0]; | fd = td->td_retval[0]; | ||||
if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) { | if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) { | ||||
if (fp->f_type != DTYPE_VNODE) { | if (fp->f_type != DTYPE_VNODE) { | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
goto done; | goto done; | ||||
} | } | ||||
sx_slock(&proctree_lock); | sx_slock(&V_proctree_lock); | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { | if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
sx_sunlock(&proctree_lock); | sx_sunlock(&V_proctree_lock); | ||||
/* XXXPJD: Verify if TIOCSCTTY is allowed. */ | /* XXXPJD: Verify if TIOCSCTTY is allowed. */ | ||||
(void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, | (void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, | ||||
td->td_ucred, td); | td->td_ucred, td); | ||||
} else { | } else { | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
sx_sunlock(&proctree_lock); | sx_sunlock(&V_proctree_lock); | ||||
} | } | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
} | } | ||||
done: | done: | ||||
#ifdef DEBUG | #ifdef DEBUG | ||||
#ifdef LINUX_LEGACY_SYSCALLS | #ifdef LINUX_LEGACY_SYSCALLS | ||||
if (ldebug(open)) | if (ldebug(open)) | ||||
▲ Show 20 Lines • Show All 1,520 Lines • Show Last 20 Lines |