mirror of
https://github.com/opnsense/src.git
synced 2026-03-04 22:32:37 -05:00
The existing code calls kern_open() to resolve the vnode of a pathname right after a stat(). This is not correct, because it causes random character devices to be opened in /dev. This means ls'ing a tape streamer will cause it to rewind, for example. Changes I have made: - Add kern_statat_vnhook() to allow binary emulators to `post-process' struct stat, using the proper vnode. - Remove unneeded printf's from stat() and statfs(). - Make the Linuxolator use kern_statat_vnhook(), replacing translate_path_major_minor_at(). - Let translate_fd_major_minor() use vp->v_rdev instead of vp->v_un.vu_cdev. Result: crw-rw-rw- 1 root root 0, 14 Feb 20 13:54 /dev/ptmx crw--w---- 1 root adm 136, 0 Feb 20 14:03 /dev/pts/0 crw--w---- 1 root adm 136, 1 Feb 20 14:02 /dev/pts/1 crw--w---- 1 ed tty 136, 2 Feb 20 14:03 /dev/pts/2 Before this commit, ptmx also had a major number of 136, because it silently allocated and deallocated a pseudo-terminal. Device nodes that cannot be opened now have proper major/minor-numbers. Reviewed by: kib, netchild, rdivacky (thanks!) |
||
|---|---|---|
| .. | ||
| linux_emul.c | ||
| linux_emul.h | ||
| linux_file.c | ||
| linux_file.h | ||
| linux_futex.c | ||
| linux_futex.h | ||
| linux_getcwd.c | ||
| linux_ioctl.c | ||
| linux_ioctl.h | ||
| linux_ipc.c | ||
| linux_ipc.h | ||
| linux_mib.c | ||
| linux_mib.h | ||
| linux_misc.c | ||
| linux_misc.h | ||
| linux_signal.c | ||
| linux_signal.h | ||
| linux_socket.c | ||
| linux_socket.h | ||
| linux_stats.c | ||
| linux_sysctl.c | ||
| linux_sysproto.h | ||
| linux_time.c | ||
| linux_uid16.c | ||
| linux_util.c | ||
| linux_util.h | ||