summaryrefslogtreecommitdiffstats
path: root/sys/gnu
Commit message (Collapse)AuthorAgeFilesLines
* This Implements the mumbled about "Jail" feature.phk1999-04-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-282-4/+4
| | | | (Edited automatically)
* Suser() simplification:phk1999-04-274-10/+10
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Fix so that this driver works again when compiled with EGCS (whichdavidn1999-04-221-31/+31
| | | | | apparently has a much better optimiser, requiring 'volatile' memory to be declared as such).
* Remove unused function int fi() {return 0;}eivind1999-04-111-4/+1
|
* Staticize.eivind1999-04-111-2/+2
|
* Make NDGBPORTS an official option.joerg1999-03-131-1/+2
|
* Don't depend on <ufs/ufs/quota.h> or another (old) prerequisite includingbde1999-03-062-2/+4
| | | | | <sys/queue.h>. This fixes my recent breakage of biosboot by unpolluting <ufs/ufs/quota.h> in the !KERNEL case.
* Merge patch to ufs_vnops.c's ufs_rename to the copy of ufs_rename thatimp1999-03-022-0/+10
| | | | | | lives in ext2_vnops.c for ext2fs. Also remove cast from comparision. Bruce pointed out that it was bogus since we'd force a signed comparision when we really wanted an unsigned comparison.
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).bde1999-02-252-0/+2
|
* Use suser() to check for super user rather than examining cr_uid directly.phk1999-01-302-4/+6
| | | | | | Use TTYDEF_SPEED rather than 9600 a couple of places. Reviewed by: bde, with a few grumbles.
* Fixed parenthesization botch in previous commit. Async update of inodesbde1999-01-292-2/+2
| | | | was broken.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-282-4/+4
| | | | kernel compile
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-272-4/+4
| | | | | | | kernel compile. This commit includes significant work to proper handle const arguments for the DDB symbol routines.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-2718-124/+124
| | | | kernel compile
* Remove LKM support, src/lkm that built it is gone and it never worked as anpeter1999-01-171-35/+1
| | | | LKM anyway. It does work as a preloaded KLD module though.
* Avoid warning for unused variable.eivind1999-01-112-4/+4
|
* Don't pass unused unused timestamp args to UFS_UPDATE() or wastebde1999-01-0712-82/+42
| | | | | time initializing them. This almost finishes centralizing (in-core) timestamp updates in ufs_itimes().
* UFS_UPDATE() takes a boolean `waitfor' arg, so don't pass it the valuebde1999-01-062-2/+2
| | | | | | MNT_WAIT when we mean boolean `true' or check for that value not being passed. There was no problem in practice because MNT_WAIT had the magic value of 1.
* Ifdefed conditionally used simplock variables.bde1999-01-021-1/+3
|
* PR: kern/8819dillon1998-12-131-55/+55
| | | | | Trivial change of macro name from DEBUG to AWE_DEBUG to avoid conflict with kernel DEBUG option.
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-076-30/+16
| | | | and local variables, goto labels, and functions declared but not defined.
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-1/+1
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* Fixed a misspelling of boolean true as MNT_WAIT.bde1998-11-152-2/+2
|
* Finished updating module event handlers to be compatible withbde1998-11-151-2/+2
| | | | modeventhand_t.
* add #include <sys/kernel.h> where it's needed by MALLOC_DEFINE()peter1998-11-101-1/+2
|
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagspeter1998-10-316-14/+12
| | | | rather than abusing the list next pointer with a magic number.
* error return assignment was less than ideal. Fix the part that causedpeter1998-10-292-4/+4
| | | | | warnings to be the same as the ffs code. Previously, any error from the UFS_UPDATE() call was lost (I think).
* Use vtruncbuf() to clean out cached blocks on a file shorten rather thanpeter1998-10-292-6/+8
| | | | | the more expensive vinvalbuf(), based on the FFS version of the same routine. I don't have any ext2fs filesystems to test this on.
* Oops, the redundant tests for major numbers weren't redundant here.bde1998-10-272-4/+6
| | | | | | | They checked for the magic major number for the "device" behind mfs mount points. Use a more obvious check for this device. Debugged by: Andrew Gallatin <gallatin@cs.duke.edu>
* Removed redundant bitrotted checks for major numbers instead of updatingbde1998-10-262-8/+4
| | | | them.
* Don't follow null bdevsw pointers. The `major(dev) < nblkdev' test rottedbde1998-10-252-2/+4
| | | | | when bdevsw[] became sparse. We still depend on magic to avoid having to check that (v_rdev) device numbers in vnodes are not NODEV.
* Initialize earlier (ie: before npx) in case it makes any difference.peter1998-10-181-4/+8
| | | | | Print a message when it attaches to pmath_emulate if bootverbose so that we can be sure it's online.
* OOPS!peter1998-10-181-2/+2
| | | | | | Supply the moduledata handle rather than the event dispatcher function. This should explain the panic on boot problem that's been discussed in -current at the moment. Both machines had GNU_MATH_EMULATE.
* *gulp*. Jordan specifically OK'ed this..peter1998-10-161-9/+29
| | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's.
* Fixed bloatage of `struct inode'. We used 5 "spare" fields for ext2fs,bde1998-10-138-16/+16
| | | | | | | | | | | | | | but when i_effnlink was added to support soft updates, there was only room for 4 spares. The number of spares was not reduced, so the inode size became 260 (on i386's), or 512 after rounding up by malloc(). Use one spare field in `struct dinode' instead of the 5th spare field in the inode and reduced to 4 spares in the inode so that the size is 256 again. Changed the types of the spares in the inode from int to u_int32_t so that the inode size has more chance of being <= 256 under other arches, and downdated ext2fs to match (it was broken to use ints before rev.1.1).
* Quick fix for not being able to sync all the buffers in boot() ifbde1998-10-034-16/+20
| | | | | | | | | | | | | an ext2fs file system is mounted. The soft update changes added a check for B_DELWRI buffers. This exposed the complete brokenness of the previous quick fix for failing syncs (PR 3571, committed on 1997/08/04). Use a new buffer flag B_DIRTY and don't abuse B_DELWRI. B_DIRTY buffers are still written too late, as broken in the previous fix. This is fairly harmless, because B_DIRTY is only used for bitmap buffers and fsck.ext2 can fix up the bitmaps perfectly. Fixed a race in ULCK_BUF() (bremfree() was outside of the splbio() section).
* Fixed initialization of new inodes. ext2fs doesn't clear inodes whenbde1998-09-292-2/+6
| | | | | | they are deleted, so inodes must be cleared when they are reused, but we didn't clear the indirect blocks. This caused serious filesystem corruption.
* Updated ext2_reload() and ext2_sync(). Locking was broken, and MNT_LAZYbde1998-09-262-84/+126
| | | | | | | | | syncs weren't optimized properly (they probably still aren't, but are bug for bug compatible with ffs). These fixes are mostly academic, since ext2fs is too broken to mount read-write (it apparently doesn't clear indirect blocks). Obtained from: mostly from Lite2
* Fixed missing newlines in messages in ext2_check_descriptors().bde1998-09-262-16/+24
| | | | | | | Fixed vnode and memory leaks after an unlikely (?) error in ext2_mountfs(). Fixed an unconditional memory leak in ext2_unmount().
* Fixed clean flag handling:bde1998-09-264-20/+72
| | | | | | | | | | | | | | | | | | | | | | | Fixes for bugs not shared with ffs: - don't mount unclean filesystems rw unless forced to. - accept EXT2_ERROR_FS (treat it like !EXT2_VALID_FS). We still don't set this or honour the maximal mount count. - don't attempt to print the name of the mount point when mounting an unclean file system, since the name of the previous mount point is unknown and the name of the current mount point is still "". Fixes for bugs shared with ffs until recently: - don't set the clean flag on unmount of an initially-unclean filesystem that was (forcibly) mounted rw. - set the clean flag on rw -> ro update of a mounted initially-clean filesystem. - fixed some style bugs (mostly long lines). The fixes are slightly simpler than for ffs, because the relevant on-disk state is not a simple boolean variable, and the superblock has a core-only extension. Obtained from: parts from ffs_vfsops.c, parts from NetBSD
* Fixed the usual missing permissions checks in mount(). As for cd9660,bde1998-09-092-2/+70
| | | | | | the damage was limited by the default of 0 for vfs.usermount. Obtained from: Lite2 via the -current ffs_vfsops.c
* Don't forget to initialize the inode lock. This bug causedbde1998-09-092-0/+2
| | | | | | | | | surprisingly few problems. Most fields were initialized to the correct values by bzero(), but lk_prio was 0 instead of PINOD (=8), the lk_wmsg was NULL instead of "ext2in", and lk_lockholder was 0 instead of -1. Obtained from: Lite2 via the -current ffs_vfsops.c
* Support compiling with `gcc -pedantic' (don't use hard newlines inbde1998-09-092-38/+40
| | | | (asm) string constants).
* Removed statically configured mount type numbers (MOUNT_*) and allbde1998-09-072-6/+6
| | | | | | | | | references to them. The change a couple of days ago to ignore these numbers in statically configured vfsconf structs was slightly premature because the cd9660, cfs, devfs, ext2fs, nfs vfs's still used MOUNT_* instead of the number in their vfsconf struct.
* Fixed printf format errors. Only one left in LINT on i386's.bde1998-08-242-21/+17
|
* Added D_TTY to the cdevswitch flags for all tty drivers. This is requiredbde1998-08-232-16/+18
| | | | | | | | | for the Lite2 fix for always returning EIO in dead_read(). Cleaned up the cdevswitch initializers for all tty drivers. Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater() is now called centrally for opens, not just for parameter changes.
* Quick fix for breakage of read clustering on non-IDE drives. Readbde1998-08-182-4/+4
| | | | | | | | | | | | | | clustering is obsolescent technology so hardly anyone noticed. On a DORS 32160 SCSI drive with 4 tags, read clustering makes very little difference even for huge sequential reads. However, on a ZIP SCSI drive with 0 tags, the minimum overhead per block is about 40 msec, so very large clusters must be used to get anywhere near the maximum transfer rate. Using clusters consisting of 1 8K block reduces the transfer rate to about 250K/sec. Under msdosfs, missing read clustering is normal and a cluster size of 1 512 byte block reduces the transfer rate to about 25K/sec. Broken in: rev.1.18
* Use [u]intptr_t instead of [u_]long for casts between pointers andbde1998-08-166-22/+28
| | | | integers. Don't forget to cast to (void *) as well.
* Use offsetof() to avoid some casts from pointers to integers (of abde1998-08-151-1/+3
| | | | possibly different size).
OpenPOWER on IntegriCloud