Commit Graph

1785 Commits

Author SHA1 Message Date
christos ff3d818d91 Handle -C\ndir\n in a file containing a file list. From Eric Gillespie. 2002-10-18 13:45:05 +00:00
itojun 8eb125554b exit with 0 if the input is empty of not a tar file. matches GNU tar behavior.
solves PR 18689.
2002-10-18 11:54:22 +00:00
itojun 68603e5242 correct use of format string (signedness, %ldd). PR 18679 2002-10-17 23:50:17 +00:00
provos 04a469212b cleanup 2002-10-17 04:45:04 +00:00
christos ed254499e5 Factor out some more code, and don't expand names in ././@LongLink records. 2002-10-17 01:08:22 +00:00
christos 860d26c69b Fix DEFOP botch. DEFOP == LIST so tar -tvf stopped working. (hi soren) 2002-10-17 00:42:02 +00:00
christos 4472ef1520 Add proper longlink support. Previously we handled longname support, and
the longlink support was completely wrong.
2002-10-17 00:32:36 +00:00
christos 69ea8215e0 add commas between options. Suggested by wiz. 2002-10-16 23:52:06 +00:00
soren 4ba08d1776 Tweak tar_usage(). 2002-10-16 23:37:49 +00:00
soren af892f930e Have tar require a specific action as documented. 2002-10-16 23:22:59 +00:00
soren f9d5774005 Sync cpio_usage() with cpio.1 as with pax and tar. 2002-10-16 22:38:36 +00:00
christos 4dbb5fa93c grr, I put these in the wrong spot. 2002-10-16 21:49:08 +00:00
christos 24dd1a7d61 Document the long options. 2002-10-16 21:47:13 +00:00
christos 169f625866 we need to have -force-local on pax. 2002-10-16 21:45:31 +00:00
christos f830cb1865 turn gnu tar off by pax and cpio front ends. 2002-10-16 18:53:40 +00:00
christos 706c1ce906 Flip the pax switch 2002-10-16 15:23:59 +00:00
itojun 553d79070e \n before new sentence. 2002-10-16 14:58:33 +00:00
itojun e8745f23b6 sync better w/ openbsd tree (cosmetic) 2002-10-16 14:56:11 +00:00
christos 650f61c526 Warn if we are trying to read a gnu tar archive, if --strict is specified. 2002-10-16 04:40:55 +00:00
christos f70dfaaf73 Support gnu long filename extensions by default for tar on create, list, and
extract. We now generate GNU tar archives by default ("ustar  ^@" instead of
"ustar^@00"). GNU extensions can be disabled with --strict.

XXX: long symlinks untested.
2002-10-16 03:46:07 +00:00
christos ca541391bc PR/18663: Jeremy Reed: pax/tar/cpio allows ".." in names.
We now disallow it by default on both archive creation and extraction.
Add --insecure option to override.
2002-10-15 16:16:29 +00:00
christos 675306eb0e implement fast read. nothing to it really, it was already there as -q option. 2002-10-15 14:58:53 +00:00
christos 9a9c32e167 Add all the gnu cpio long options. 2002-10-15 14:51:04 +00:00
lukem e490a5c798 don't compile in `-h' as a synonym for the command that the argument is for.
this fix is hokey, but works as well as the previous solution for -j.
2002-10-15 04:15:58 +00:00
lukem 7f200231eb fix previous: SMALLPROG w/o HOSTPROG still needs <bsd.prog.mk>. (hi christos) 2002-10-14 16:03:51 +00:00
soren f05dd4bfd6 Sync tar_usage() with tar.1. 2002-10-14 15:04:41 +00:00
christos 7e35f7247f don't support rmt for SMALLPROG 2002-10-14 14:41:22 +00:00
christos 8ffc5b1c59 -T expects an argument. From Eric Gillespie, thanks. 2002-10-13 17:23:40 +00:00
christos 011898cd8e Fix error in counting the archive's name length. From Eric Gillespie, thanks! 2002-10-13 17:21:50 +00:00
christos cd1f9fe466 If the archive refers to stdin, the archive's name is null. Check for
null when we see if it refers to a remote file. From Eric Gillespie, thanks!
2002-10-13 17:19:33 +00:00
mrg a9a7ae57f7 fix "pax -rw" processing. for some reason, it was now written to process
"pax -rwvpe a b" as "pax -rwvpe b a", and "pax -rwvpe a b c" as
"pax -rwvpe b c a".  only the part of revision 1.40 that broken this has
been reverted.
2002-10-13 11:31:02 +00:00
mrg 20bac70304 make this build on LP64 2002-10-13 00:34:16 +00:00
mrg ed83539f6e add a "+" to the options string rather than setting POSIXLY_CORRECT 2002-10-13 00:32:09 +00:00
mrg 9b3e4b9e61 include <string.h> for mem* and str* 2002-10-13 00:31:28 +00:00
wiz eb12ddd1f9 Miscellaneous fixes. 2002-10-12 22:36:01 +00:00
thorpej 6fe78b30af Only include <rmt.h> if SUPPORT_RMT. 2002-10-12 19:21:12 +00:00
thorpej 32c48247e8 It doesn't help much to skip linking librmt if HOSTPROG but leave
all the librmt calls in the program.  So, make librmt support conditional
on #ifdef SUPPORT_RMT, and define that when NOT building as a HOSTPROG.
2002-10-12 18:49:28 +00:00
christos 0c61202168 merge OpenBSD changes:
- correct -C processing
    - add ability to read filenames and flags from a file
    - don't print dangerous escape sequences to the terminal
    - use strlcpy/strncpy properly.
    - handle tmpfile creation better.
    - improve documentation of options.
    - handle stdout/stderr list selection correctly.
    - kill gzip when we get interrupted.
    - simplify gzip setup.
    - add more flags to programs.

additional changes:
    - librmt processing.
    - set POSIXLY_CORRECT in options parsing.
    - prevent more string overruns.
    - support -T

we don't turn the switch on to replace tar and cpio yet.
2002-10-12 15:39:29 +00:00
christos b73dcc21ce man pages from OpenBSD.
TODO: add long option documentation.
2002-10-12 15:30:54 +00:00
wiz 71c3607b93 Miscellaneous fixes by Martin Weber (ephaeton at that gmx net thingy). 2002-10-12 00:02:47 +00:00
provos 690d7c3ad0 fix type; its "as :group" 2002-10-11 23:31:00 +00:00
provos 61e8c76047 support for privilege elevation.
with privilege elevation no suid or sgid binaries are necessary any
longer.  Applications can be executed completely unprivileged. Systrace
raises the privileges for a single system call depending on the
configured policy.

Idea from discussions with Perry Metzger, Dug Song and Marcus Watts.
Approved by christos and thorpej.
2002-10-11 21:54:55 +00:00
christos 35bdad4ed7 str{n,l}cpy fixes and buffer limit fixes from OpenBSD 2002-10-11 13:07:36 +00:00
provos 931062ce16 translation for socket system call 2002-10-11 04:40:11 +00:00
provos c603c2b26f enable meta key in emacs mode for 7-bit locales. approved thorpej. 2002-10-10 17:41:19 +00:00
provos 1b3623c27a correctly evaluate group predicates 2002-10-10 14:06:30 +00:00
provos 306becc9b9 add A to usage; noted by nickus@mpi-cbg.de 2002-10-08 14:50:57 +00:00
provos 89afc325c0 predicates are part of the grammar now; in non-root case, predicates are
evaluated only once; in root case, predicates and variable expansion are
dynamic.
2002-10-08 14:49:23 +00:00
itojun ed21532463 "output" is a pointer of size "outlen", so use outlen instead of
sizeof(output)

From: "Vincent Labrecque" <vincent@psyfreaks.ca>
2002-10-08 02:47:59 +00:00
christos 1ce87c4b29 - it is wrong to put inton/intoff arount ckmalloc(), because the code
around it is the one that does this.
- whitespace fixes.
2002-10-07 14:26:49 +00:00
christos 202746f803 explain what's breaking with alignments > 16, but no fix yet. 2002-10-07 14:26:08 +00:00
provos 4b7278c7f2 use FNM_LEADING_DIR 2002-10-06 03:16:25 +00:00
provos 9008ac33c8 assume that inserting a template implies permit for the current syscall 2002-10-06 01:28:55 +00:00
christos b9d3050e20 Rename ALIGN to SHELL_ALIGN and simplify macro so that it does not have side
effects, and add double to it, so that it aligns doubles correctly too. This
is just a workaround to fix the sparc64 problem where ALIGN() is now defined
in some include file to be 16 instead of 8. Thanks to martin for debugging this.
2002-10-04 13:15:51 +00:00
wiz 881c258156 additional and positive with two is. From Adrian Mrva. 2002-10-02 15:59:51 +00:00
wiz 06bd76cf9a parameter, not paramter. By Adrian Mrva. 2002-10-02 15:58:04 +00:00
wiz 1da66f1f4c filesystem -> file system, automaticly -> automatically. 2002-10-02 10:01:46 +00:00
wiz 1d605b2386 evironment -> environment. 2002-10-02 09:57:14 +00:00
wiz f3e4defc56 Use more mdoc. 2002-10-01 15:11:08 +00:00
wiz 2e6e2165c0 Use more mdoc, particularly to get rid of some \*[Lt] and \*[Gt]. 2002-10-01 15:06:31 +00:00
provos a79af4d624 fix return value; from marius@umich.edu 2002-09-28 17:56:54 +00:00
mycroft 6092f7d52b Revert the previous for now. This is truly gross. 2002-09-28 03:15:43 +00:00
mycroft 7973b7a0ac Remove the duplicate setpgid() in forkparent(). The real bug was freeing the
job structure in the child and referencing freed memory.
2002-09-28 03:08:00 +00:00
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