Commit Graph

1672 Commits

Author SHA1 Message Date
christos
4783843fdc Revert previous change. No need to save rootshell. It is only affecting
the non-vfork case. Having said that, it would be nice if pipelines of
simple commands were vforked too. Right now they are not.
Explain that setpgid() might fail because we are doing it both in the
parent and the child case, because we don't know which one will come
first.
Suspending a pipeline prints %1 Suspended n times where n is the number
of processes, but that was there before. It is easy to fix, but I'll
leave the code alone for now.
2002-09-28 01:25:01 +00:00
christos
6f48233483 Deal with rootshell not being maintained correctly in the vfork() case.
Propagate isroot, throughout the eval process and maintain it properly.
Fixes sleep 10 | cat^C not exiting because sleep and cat ended up in
their own process groups, because wasroot was always true in the children.
2002-09-27 22:56:24 +00:00
mycroft
d84d36165d Clean up INTOFF/INTON usage a little -- none of fork{shell,parent,child}()
screw with them now, only their callers.
2002-09-27 21:32:24 +00:00
thorpej
bb95e8cb62 Revert previous; the change that required it will be done differently. 2002-09-27 21:04:46 +00:00
christos
ad1e7bca30 off by one in nprocs. 2002-09-27 21:04:08 +00:00
christos
35975338b0 Put back charles' fixes from -r1.60 2002-09-27 20:24:36 +00:00
christos
edcb454443 VFork()ing shell: From elric@netbsd.org:
Plus my changes:
	- walking process group fix in foregrounding a job.
	- reset of process group in parent shell if interrupted before the wait.
	- move INTON lower in the dowait so that the job structure is
	  consistent.
	- error check all setpgid(), tcsetpgrp() calls.
	- eliminate unneeded strpgid() call.
	- check that we don't belong in the process group before we try to
	  set it.
2002-09-27 18:56:50 +00:00
mycroft
2aa6ebd4ed In evalpipe(), move the INTOFF after the waitforjob(), to prevent possible
race conditions -- now we always synchronously wait for the job to finish.
In evalcommand(), add the same INTOFF/INTON locking as evalpipe(), to prevent
leaving internal state inconsistent, and also to insure that we synchronously
wait for the job.
2002-09-27 17:37:12 +00:00
christos
6438e7dcdc no SYSV for eagain, enable EMFILE 2002-09-27 16:56:15 +00:00
thorpej
6a244932ed Only use the MKDYNAMICROOT semantics (i.e. -rpath=/lib,/usr/lib and
-dynamic-linker=/libexec/ld.elf_so) if the BINDIR of the program being
built is /bin or /sbin.

The reason we do this is because now all programs *except* those in
/bin and /sbin (i.e. the "special cases") match the default the compiler
uses, which is what is used for things in e.g. xsrc, pkgsrc, and other
random 3rd party programs.
2002-09-27 15:56:39 +00:00
provos
0d78fff152 complete file names including a ~ correctly. 2002-09-27 13:23:55 +00:00
simonb
4bce9043f0 Need to initialise the blocksize variable if the -i option is used
too.  The code in display() could possibly be a bit smarter about this
requirement...

Fixes the problem in PR bin/18321 from David Laight and PR bin/18436
from FUKAUMI Naoki.
2002-09-27 12:01:51 +00:00
provos
4fd29e5dcf human-readable output via -h flag. output matches Linux and other BSDs.
partly from kstailey@openbsd.org.  approved itojun and perry.
2002-09-26 16:27:43 +00:00
wiz
6ab45c70b7 Begin new sentences on new lines. From Robert Elz (kre at munnari oz au). 2002-09-26 11:11:17 +00:00
wiz
14dfaa4b03 New policy: New sentences start on a new line.
Patches by Robert Elz <kre at munnari oz au>, with minimal changes by me.
2002-09-25 15:18:36 +00:00
provos
a94ce5a752 enable emacs mode, add tab key to do completion in emacs and vi mode.
from millert@openbsd.org.  approved by perry and thorpej.
2002-09-25 02:55:03 +00:00
provos
f9b44bb190 change complete-list to first complete and then print a list,
also complete after '=' (dd), and ':' (ssh) and ` (backtick)
improvements from camield@openbsd.org.  approved by perry and thorpej.
2002-09-25 02:41:11 +00:00
itojun
d584f0a0fc support for templates. they allow fast generation of new policies. an
appropriate template can be inserted during initial policy generation.
from provos
2002-09-23 04:35:41 +00:00
mycroft
826e316675 select() -> poll() 2002-09-21 18:15:57 +00:00
jschauma
9f40601644 comment out the (no longer) builtin newgrp 2002-09-20 20:57:58 +00:00
jschauma
b186175fa1 We don't have 'newgrp' -> ifdef the builtin alias. This prevents
the shell from unexpectedly dying if a user enters the (nonexistent)
'newgrp' command.  OK'd by perry.
As seen in OpenBSD.
2002-09-20 20:07:09 +00:00
itojun
ca5a36677b split white space and single line policy processing into separate
functions.  from provos
2002-09-17 05:07:21 +00:00
itojun
0b2d2fe3d7 daemon should not change the directory. from provos 2002-09-17 04:54:36 +00:00
itojun
c1261b4aff periodically save policies that have been modified. from provos
>here is a diff that will cause systrace to periodically save policies
>that have been modified.  Useful if you run systrace on an xterm and
>kill it accidently.  Or other applications like opera that are long
>running and can cause weird crashes.
2002-09-16 04:31:46 +00:00
thorpej
e41b1aa4a2 Use "unsigned char" and "char" instead of "u_int8_t" and "int8_t"
for TARGET_CHAR when building mksyntax.  This isn't perfect, but
it lets the host tool work on non-BSD systems without completely
redoing how sh is built.
2002-09-15 00:19:22 +00:00
sommerfeld
af723a4db0 Use the output blocksize when computing how much room to leave for the
-s option, to suppress unnecessary leading spaces.
2002-09-14 04:25:55 +00:00
thorpej
42321e369a Don't use MAX(); not all systems have it, and this is a host tool. 2002-09-13 18:07:52 +00:00
enami
caa54090d6 Add comment about my rev. 1.27 change. 2002-09-04 04:21:54 +00:00
tron
4fc0806163 Ignore EINVAL returned from fsync(2) because it is the expected error code
if we try to use it on a pipe.
2002-09-03 06:17:26 +00:00
enami
cef250dab9 Detect the last nfs write error. 2002-09-01 11:33:22 +00:00
itojun
c81b949059 allow # in system call name. remove trailing white space.
from provos
2002-08-30 17:09:31 +00:00
itojun
b6aefbe19f sync with latest systrace in openbsd tree. improved systrace with chroot. 2002-08-28 03:52:44 +00:00
lukem
ed401558f2 Implement MKDYNAMICROOT, which currently defaults to "no", but will
be changed in the future to "yes".

If MKDYNAMICROOT == "no", there is no change from existing behaviour
of a static /bin and /sbin (and a few programs in elsewhere).

If MKDYNAMICROOT == "yes", the following changes occur:
    in <bsd.own.mk>:
	SHLIBDIR?=     /lib
	SHLINKDIR?=	/lib
    in various Makefiles, the following entry is DISABLED.
	LDSTATIC?=-static
This results in all programs (except those "standalone" programs built
in sys/arch/*/stand) are linked dynamically, the shared linker is moved
from /usr/libexec to /lib (with a compat symlink), and the shared
libraries used by /bin and /sbin programs are moved from /usr/lib to
/lib (with compat symlinks).
2002-08-27 14:46:11 +00:00
lukem
146a774973 Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc). 2002-08-19 09:56:00 +00:00
wiz
33bb527e01 Drop trailing whitespace. 2002-08-13 13:22:35 +00:00
sommerfeld
8f4d948b68 Improve some of the description of optional drive features. 2002-08-13 13:16:24 +00:00
itojun
c3ca2a9ab6 calloc() arg mistake. it's (nelem, size). from openbsd 2002-08-12 02:37:26 +00:00
soren
236006d5dc Remove extraneous \n's in {err,warn}{,x} that used to be printfs. 2002-08-08 13:24:12 +00:00
itojun
95c7243aec more effort to make it compile on platforms w/o linux emul 2002-08-02 14:29:34 +00:00
soren
e426c0fac8 Following FreeBSD's example, remove the old pre-statfs(2) code for
examining FFS filesystems directly. This also gets rid of df(1)'s
setgid operator bit.
2002-08-02 08:17:12 +00:00
christos
1eb5da90ed don't include utmp.h 2002-08-01 20:05:48 +00:00
wiz
0f88938132 Remove unneeded utmp.h include. 2002-08-01 18:41:34 +00:00
itojun
71a4240254 aenable linux systrace only on platforms that support it.
noted by hannken@eis.cs.tu-bs.de
2002-08-01 08:47:03 +00:00
itojun
2b8709b902 backout previous. mandoc(4) lies. 2002-07-31 00:28:02 +00:00
itojun
822deb809a .Bd -offset does not take numeric arg, but string. 2002-07-31 00:26:56 +00:00
jdolecek
bdd538626a re-apply part of rev. 1.4 - Explain why you would use this.
contrary to rev. 1.4, keep 'The options are as follows' sentence, since
this seems to be used more on system manpages
2002-07-30 21:58:25 +00:00
jdolecek
e9b2b4b074 re-apply changes in rev. 1.3 - Slight changes to the English. 2002-07-30 21:43:26 +00:00
wiz
93aef72209 Sort sections, Sh -> Ss in one place. 2002-07-30 17:06:58 +00:00
itojun
4f0c9c76b6 sync up with latest openbsd systrace.
- avoid race conditions by having seqno in ioctl
- better uid/gid tracking
- "replace" policy to replace args
- less diffs, as many of local changes were fed back to openbsd already

due to the 1st item, it was impossible for us to provide backward-compatibility
(new kernel + old bin/systrace won't work).  upgrade both.
2002-07-30 16:29:28 +00:00
soren
8f6326d364 A local copy of <sys/tree.h> is unnecessary. 2002-07-30 06:09:56 +00:00