Commit Graph

961 Commits

Author SHA1 Message Date
sheldonh
0cfa55aca8 Add module dependency on libmchain.
With this change, mounting an smb share (using mount_smb, which is not
yet included in the tree) without any of smbfs, libiconv or libmchain
compiled into the kernel or loaded works.
2001-12-13 13:08:34 +00:00
alfred
7ae2ddd405 Fix select on named pipes without a reader.
PR: kern/19871
MFC after: 1 month
2001-12-12 09:35:33 +00:00
green
b40c254986 Add VOP_GETEXTATTR(9) passthrough support to pseudofs.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2001-12-11 20:48:20 +00:00
des
a3fff002fa Remove an obsolete prototype for procfs_kmemaccess().
Submitted by:	rwatson
2001-12-11 19:07:10 +00:00
obrien
7fd9a6a23a Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
des
2a99d8ecba Fix various bugs in the debugging code and reenable it. 2001-12-09 00:35:30 +00:00
des
b2e2ac1d06 Fix an incorrect PFS_TRACE. Also, use __func__ instead of __FUNCTION__. 2001-12-09 00:28:12 +00:00
des
21823ec3f8 Fix a KSEfication brain-o in procfs_doprocfile(): return the path of the target process,
not the calling process.  While we're here, also unstaticize procfs_doprocfile() and
procfs_docurproc() so linprocfs can call them directly instead of duplicating them.

Submitted by:	Dominic Mitchell <dom@semantico.com>
2001-12-08 22:34:14 +00:00
des
e05a1e1712 Pseudofsize procfs(5). 2001-12-04 01:35:06 +00:00
rwatson
b5de442911 o Introduce pr_mtx into struct prison, providing protection for the
mutable contents of struct prison (hostname, securelevel, refcount,
  pr_linux, ...)
o Generally introduce mtx_lock()/mtx_unlock() calls throughout kern/
  so as to enforce these protections, in particular, in kern_mib.c
  protection sysctl access to the hostname and securelevel, as well as
  kern_prot.c access to the securelevel for access control purposes.
o Rewrite linux emulator abstractions for accessing per-jail linux
  mib entries (osname, osrelease, osversion) so that they don't return
  a pointer to the text in the struct linux_prison, rather, a copy
  to an array passed into the calls.  Likewise, update linprocfs to
  use these primitives.
o Update in_pcb.c to always use prison_getip() rather than directly
  accessing struct prison.

Reviewed by:	jhb
2001-12-03 16:12:27 +00:00
bp
f4a7e7e6df Catch up with KSE changes.
Submitted by:	Max Khon <fjoe@iclub.nsu.ru>
2001-12-02 08:56:58 +00:00
jhb
519b6eac09 Fix indentation after removing GEMDOS support. Whitespace changes only. 2001-11-28 18:29:16 +00:00
jhb
d5902a539c Use suser_td() instead of explicitly checking cr_uid against 0.
PR:		kern/21809
Submitted by:	<mbendiks@eunet.no>
Reviewed by:	rwatson
2001-11-28 18:25:39 +00:00
jhb
6fd89a7d16 Axe more unused GEMDOS code that was #ifdef atari.
PR:		kern/21809
Submitted by:	<mbendiks@eunet.no>
2001-11-28 16:56:42 +00:00
jhb
84addb4e07 Remove GEMDOS support from msdosfs. I don't think anyone is going to
port FreeBSD to Atari machines any time soon.
2001-11-27 21:00:15 +00:00
des
ab5488a6a1 Add support for a last-close handler.
Revert the module version bumps; they're quite pointless as long as the
only pseudofs consumer is linprocfs, which is in the tree.
2001-11-27 13:26:27 +00:00
ken
5cc7e8df85 Fix mounting root from a ISO9660 filesystem on a SCSI CDROM.
The problem was that the ISO9660 code wasn't opening the device prior to
issuing ioctl calls.  In particular, the device must be open before
iso_get_ssector() is called in iso_mountroot().

If the device isn't opened first, the disk layer blows up due to an
uninitialized variable.

The solution was to open the device, call iso_get_ssector() and then close
it again.

The ATAPI CDROM driver doesn't have this problem because it doesn't use the
disk layer, and evidently doesn't mind if someone issues an ioctl without
first issuing an open call.

Thanks to phk for pointing me at the source of this problem.

Tested by:	dirk
MFC after:	1 week
2001-11-27 03:55:43 +00:00
jhb
a65864a971 Replace 'p' with 'td' as appropriate. 2001-11-27 00:34:13 +00:00
jhb
35af124436 GC compat macros HASHINIT, VOP__LOCK, VOP__UNLOCK, VGET, and VN_LOCK. 2001-11-27 00:18:33 +00:00
jhb
0dc259caa3 Expand LOCKMGR() compat macro. 2001-11-27 00:08:04 +00:00
jhb
b4d8ef062a GC some KSE compatiblity macros that were somehow still here. 2001-11-26 23:52:35 +00:00
jhb
8698e45aa6 GC non-FreeBSD code that didn't work anyways. 2001-11-26 23:45:12 +00:00
dd
97c62fdc11 Address two minor issues: implement the _PC_NAME_MAX and _PC_PATH_MAX
pathconf() variables for directories, and set st_size and st_blocks
(of struct stat) for directories as appropriate.  Note that st_size is
always set to DEV_BSIZE, since the size of the directories is not
currently kept.

Reviewed by:	phk, bde
2001-11-25 21:00:38 +00:00
dillon
7b3d73bcc9 convert holdsock() to fget(). Add XXX reminder for future socket locking. 2001-11-24 18:28:22 +00:00
peter
fe3d7f1a83 Missing KSE s/curproc/curthread/ 2001-11-17 01:09:53 +00:00
alfred
d08d3afdaa Switch behavior of fifos to more closely match what goes on in other OSes.
Basically FIFOs become a real pain to abuse as a rendevous point without
this change because you can't really select(2) on them because they always
return ready even though there is no writer (to signal EOF).

Obtained from: BSD/os
2001-11-08 10:28:32 +00:00
peter
b3c6f7a0d9 Fix printf format bugs introduced in rev 1.34 for printing times.
quad_t cannot be printed with %lld on 64 bit systems.

Dont waste cpu to round user and system times up to long long, it is
highly improbable that a process will have accumulated 68 years of
user or system cpu time (not wall clock time) before a reboot or
process restart.
2001-11-07 02:51:25 +00:00
green
096e732df4 Correctly unlock the target process if /proc/$foo/mem is open()ed by
another process which cannot p_candebug() it.  The bug was introduced
in rev. 1.100.

Approved by:	des
2001-11-06 17:00:40 +00:00
dillon
78148daf77 Fix the fix. BIO_ERROR must be set in b_ioflags, not b_flags 2001-11-04 23:52:49 +00:00
phk
3dd31a7df9 Fix "echo > /dev/null" for non-root users which broke in previous commit. 2001-11-04 19:12:59 +00:00
dillon
c9a56085ce Add mnt_reservedvnlist so we can MFC to 4.x, in order to make all mount
structure changes now rather then piecemeal later on.  mnt_nvnodelist
currently holds all the vnodes under the mount point.  This will eventually
be split into a 'dirty' and 'clean' list.  This way we only break kld's once
rather then twice.  nvnodelist will eventually turn into the dirty list
and should remain compatible with the klds.
2001-11-04 18:55:42 +00:00
phk
8adac62c86 B_ERROR is BIO_ERROR on -current.
Now it compiles, I don't know if it works.
2001-11-04 08:53:38 +00:00
dillon
25ccde64e7 Fix a bug in CD9660 when vmiodirenable is turned on. CD9660 was assuming
that a buffer's b_blkno would be valid.  This is true when vmiodirenable
is turned off because the B_MALLOC'd buffer's data is invalidated when
the buffer is destroyed.  But when vmiodirenable is turned on a buffer
can be reconstituted from its VMIO backing store.  The reconstituted buffer
will have no knowledge of the physical block translation and the result is
serious directory corruption of the CDROM.

The solution is to fix cd9660_blkatoff() to always BMAP the buffer if
b_lblkno == b_blkno.

MFC after:	0 days
2001-11-04 06:18:55 +00:00
phk
b6f787939f Use vfs_timestamp() instead of getnanotime().
Add magic stuff copied from ufs_setattr().

Instructed by:	bde
2001-11-03 17:00:02 +00:00
phk
b86df2fcac Use vfs_timestamp() instead of getnanotime() directly.
Fix some modes on directories and symlinks.

Instructed by:	bde
2001-11-03 16:53:24 +00:00
des
7885415b9c Reduce the number of #include dependencies by declaring some of the structs
used in pseudofs.h as opaque structs.
2001-11-03 03:07:09 +00:00
dillon
6a075cd07b Adjust printfs to be time_t agnostic. 2001-10-28 22:53:45 +00:00
des
dfb5c0da6e Add VOP_IOCTL support, and fix a bug that would cause a panic if a file or
symlink lacked a filler function.
2001-10-26 18:52:47 +00:00
dillon
45a6fabe87 Change the vnode list under the mount point from a LIST to a TAILQ
in preparation for an implementation of limiting code for kern.maxvnodes.

MFC after:	3 days
2001-10-23 01:21:29 +00:00
des
335ce8775a No, you may not /* FALLTHROUGH */. Not only will you return an incorrect
result, but you'd corrupt the kernel malloc() arena if it weren't for a
small but life-saving optimization in ioctl().

MFC after:	1 week
2001-10-22 16:13:38 +00:00
des
f4cecd8fd8 Move procfs_* from procfs_machdep.c into sys_process.c, and rename them to
proc_* in the process; procfs_machdep.c is no longer needed.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 23:57:24 +00:00
jhb
6d85fccce7 Assert that a ucred is unshared before we remap its ids. 2001-10-20 03:30:34 +00:00
des
46810589e3 Argh! I updated the version number in the MODULE_DEPEND() thingamagook but
not in the actual MODULE_VERSION().  Pass me the pointy hat.
2001-10-19 18:23:51 +00:00
des
393474fd41 Switch to dynamic rather than static initialization.
This makes it possible (in theory) for nodes to be added and / or removed
from pseudofs filesystems at runtime.
2001-10-19 01:43:06 +00:00
bde
bbb90841ee Fixed bitrot in a banal comment by removing the comment. 2001-10-13 06:57:59 +00:00
bde
235dffbc18 Backed out vestiges of the quick fixes for the transient breakage of
<sys/mount.h> in rev.1.106 of the latter (don't include <sys/socket.h>
just to work around bugs in <sys/mount.h>).
2001-10-13 06:41:41 +00:00
jhb
4806d88677 Change the kernel's ucred API as follows:
- crhold() returns a reference to the ucred whose refcount it bumps.
- crcopy() now simply copies the credentials from one credential to
  another and has no return value.
- a new crshared() primitive is added which returns true if a ucred's
  refcount is > 1 and false (0) otherwise.
2001-10-11 23:38:17 +00:00
jhb
4c62ba7c58 Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +00:00
des
29c5c858fc Dissociate ptrace from procfs.
Until now, the ptrace syscall was implemented as a wrapper that called
various functions in procfs depending on which ptrace operation was
requested.  Most of these functions were themselves wrappers around
procfs_{read,write}_{,db,fp}regs(), with only some extra error checks,
which weren't necessary in the ptrace case anyway.

This commit moves procfs_rwmem() from procfs_mem.c into sys_process.c
(renaming it to proc_rwmem() in the process), and implements ptrace()
directly in terms of procfs_{read,write}_{,db,fp}regs() instead of
having it fake up a struct uio and then call procfs_do{,db,fp}regs().

It also moves the prototypes for procfs_{read,write}_{,db,fp}regs()
and proc_rwmem() from proc.h to ptrace.h, and marks all procfs files
except procfs_machdep.c as "optional procfs" instead of "standard".
2001-10-07 20:08:42 +00:00
des
0291513a41 Remove some useless preprocesor paranoia. 2001-10-07 19:41:19 +00:00