Commit Graph

760 Commits

Author SHA1 Message Date
Jordan K. Hubbard
9efde83904 Remove obsolete BUGS section which describes something which stopped
being relevant when we ripped out the BSD/VAX code.

Submitted by:	Guy Harris <gharris@flashcom.net>
1999-08-25 14:38:58 +00:00
Chris Costello
a84e119fe0 Sort cross-references. Move mount(8) down the list where it belongs, in
particular.
1999-08-25 08:45:31 +00:00
Brian Feldman
2a6d85a9cb Make the comments nice, short-but-sweet XXX format.
Submitted by:	sheldonh
1999-08-24 06:10:14 +00:00
Chris Costello
279fdba6f6 Backed out my -n change to imply -l by request of sheldonh. 1999-08-23 05:39:40 +00:00
Chris Costello
c9392e0135 Make -n flag compliant to the Single Unix Specification.
To quote their ls(1) specification:

   -n
          The same as -l, except that the owner's UID and GID numbers are
          written, rather than the associated character strings.

Reviewed by:	green
1999-08-23 01:17:58 +00:00
Brian Feldman
0337663160 Make a comment I added a bit nicer. 1999-08-22 22:32:41 +00:00
Brian Feldman
d2fed466ac Finally: fix test -x as completely as possible.
Reviewed by: bde
Reworked by: bde
1999-08-20 16:19:26 +00:00
Sheldon Hearn
1f94b77952 Take integer rounding into account in the buffer size approximation
macro. So now it's (1 +) for the sign and (+ 1) for rounding.

Reported by:	bde
1999-08-19 13:04:08 +00:00
Sheldon Hearn
008a491079 Style issues in previous commit:
Use an upward approximation of the number of characters required
        for decimal representations of uid_t, gid_t and u_quad_t, intead
	of arbitrary values that may not be safe in the future.

	Fix disordering.

Requested by:	bde
1999-08-19 11:36:12 +00:00
Brian Feldman
eb5e5558e9 The new test(1) did not use access() correctly. I don't know why, since
supposedly it's ksh-derived, and it's not broken in pdksh. I've added
a test for test running as root: if testing for -x, the file must be
mode & 0111 to get "success", rather than just existant.

Reviewed by:	chris
1999-08-18 00:18:52 +00:00
Ruslan Ermilov
64373ec6f7 Describe proper signals behavior rather than just removing it.
Remove obsoleted reference to alarm(3).

Submitted by:	bde
1999-08-16 12:36:45 +00:00
Sheldon Hearn
717a08b6e5 Replace our test(1) with NetBSD's pdksh-derived version. The code is
significantly easier to read and extend and offers a few new tests.
A few style changes taken from style(9) and OpenBSD, as well as
whitespace cleanups.

This change was discussed on freebsd-committers and freebsd-hackers
and met with approval from at least des, eivind and brian.

PR:	13091
Obtained from:	NetBSD
1999-08-16 09:44:09 +00:00
Chris Costello
cc056faf8e Bad reference of mount(1) changed to mount(8). 1999-08-14 06:26:14 +00:00
Chris Costello
bf6271821f Minor style fix - change 'if(!*v)' to 'if (!*v)' 1999-08-14 05:38:04 +00:00
Ruslan Ermilov
2028697c9a There is no special handling for SIGALRM as
sleep(3) is implemented using nanosleep(2).
1999-08-09 17:31:30 +00:00
Chris Costello
7007d55cc0 Document -f flag:
-f      Do not display a diagnostic message if chmod could not modify the
             mode for file.
1999-08-08 21:08:05 +00:00
Sheldon Hearn
f3a6a64e4a Add -n option to print numeric user and group IDs instead of names
in a long (-l) listing.

MFC-jockies should make sure that bde's concerns regarding the number
of digits required to represent a uid_t and the use of snprintf
on the associated PR have been addressed before going wild.

PR:	12866
Reported by:	Philip Kizer <pckizer@nostrum.com>
Obtained from:	NetBSD
1999-08-02 14:55:58 +00:00
Kris Kennaway
98ae496f7f Correct some style issues in my previous commit.
Submitted by:	bde
1999-07-22 14:26:21 +00:00
Sheldon Hearn
58aa6f74a2 Fix handling of the cd command inside evaluations. It was changing PWD,
which it should not do.

PR:	12578
Reported by:	Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
Submitted by:	Niall Smart <niall@pobox.com>
1999-07-19 11:00:33 +00:00
Brian Feldman
769e5815e3 Implement seekability for disk devices (not just regular files).
Also, fix pos_out() to do the same checks pos_in() did.

Done for:	jdp, luigi, the good of the world
1999-07-13 18:44:56 +00:00
Kris Kennaway
1f2dedd83d Add -W and fix the warning due to missing struct initializer 1999-07-10 05:46:44 +00:00
Bruce Evans
8c024a04db Improved error handling in rev.1.18: don't ignore failure of execve().
Fixed some style bugs in rev.1.18.
1999-07-04 15:42:04 +00:00
Kris Kennaway
f58bcbc97e Correct reference to the obsolete vadvise() to madvise() (with appropriate
arguments)

PR:		11586
Submitted by:	David Gilbert <dgilbert@velocet.ca>
Reviewed by:	Doug Rabson
1999-06-30 11:50:09 +00:00
Martin Cracauer
d430c0c167 Don't continue if parsing failed when -f is in use. Exit with nonzero value. 1999-06-25 09:04:48 +00:00
Kris Kennaway
794bf053c4 Undo some of the reversions from previous revisions, and attempt to
minimize diffs with {Net,Open}BSD

Hinted-More-Or-Less-By:	bde
1999-06-21 13:23:23 +00:00
Brian Feldman
54946e00b2 This is the second round of dd(1) changes. Some changes made/reversed by
request of Bruce. More changes may follow later. 'g' multiplier has
been added (i.e. dd seek=5g if=bigfile.) Some minor corrections were made
as well.

Noticed by: bde
1999-06-20 14:58:55 +00:00
Brian Feldman
767bc8ad79 Miscellaneous dd(1) changes: mainly fixing variable types (size_t, ssize_t,
off_t, int, u_int64_t, etc.). dd(1) should now work properly with REALLY
big amounts of data.
1999-06-19 19:49:35 +00:00
Kris Kennaway
305a253acf Changes from OpenBSD:
* Better usage() - correct syntax, display available commands
	  instead of examples
	* Accept command abbreviations
	* sprintf -> snprintf (for paranoia)
	* manpage capitalisation tweak

Obtained from:	OpenBSD
1999-06-07 13:53:57 +00:00
Kris Kennaway
f80db2b881 Use .Dq instead of ``'' in manpage
Use optimal blocksize for rm -P, instead of always using 8192-byte blocks
to overwrite the file.

Obtained from:	OpenBSD
1999-05-28 12:47:31 +00:00
Warner Losh
b790f1b6de getopt(3) returns -1 not EOF. 1999-05-23 23:24:26 +00:00
Jean-Marc Zucconi
e1e705c5b5 Chflags was clearing all flags supplied on the command line after a
clearing flag like dump or noschg, etc.

PR:		bin/10071
Submitted by:	Andreas Klussmann <andreas@infosys.heitec.net>
1999-05-21 17:04:13 +00:00
John-Mark Gurney
3bc1b1bb27 the month and three days are up for -hackers and the 24hrs for -committers.
add a -j flag that tells date not to try to set the date.  This allows you
to use date as a userland interface to strptime.

example:
TZ=GMT date -j -f "%a, %d %b %Y %T %Z" "Sun, 08 Nov 1998 02:22:20 GMT" +%s

which is the standard format for Last-modified headers in HTTP requests.

only one to respond: eivind
1999-05-14 00:28:41 +00:00
Kris Kennaway
790b555384 Grammatical fixes.
Obtained from:	OpenBSD
1999-05-12 13:48:47 +00:00
Kris Kennaway
46be34b902 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
Poul-Henning Kamp
75c1354190 This Implements the mumbled about "Jail" feature.
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/
1999-04-28 11:38:52 +00:00
Tim Vanderhoek
a261bdc7a2 .Xr chflags 1 , 1999-04-27 23:33:52 +00:00
Warner Losh
426e9c1dcc First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting
to int type and removal of some unused variables.

[*] This is explicitly allowed by style(9) when the single statement
spans more than one line.

Reviewed by: obrien, chuckr
1999-04-25 21:13:34 +00:00
Bruce Evans
712d410833 Reverted some more of rev.1.9 (emphasize that -H != -h). 1999-04-25 11:58:25 +00:00
Dmitrij Tejblum
f15076c04a Quick fix to allow transfer files >2GB. 1999-04-25 10:36:00 +00:00
Nik Clayton
f3b7e70782 Revert part of the previous commit. Keep the example that shows how the
"-h" flag is used, but use "chown" in the example instead of "file".

Prompted by: bde
1999-04-24 10:08:09 +00:00
Martin Cracauer
57b2932a14 Next approach to make loops in interactive interruptable.
PR:		bin/9173
1999-04-21 11:52:39 +00:00
Masafumi Max NAKANE
120ac26db8 Typo fix. 1999-04-19 18:48:26 +00:00
Nik Clayton
a53f20cc1e Change description of file(1) following symlinks to the truth (namely,
by default, file(1) does not follow symlinks, the -L flag must be
specified.

PR:		docs/8602
Submitted by:	Kazuo Horikawa <k-horik@yk.rim.or.jp>
Reviewed by:	nik
1999-04-14 18:45:07 +00:00
Martin Cracauer
466b673d7e Remove my temporary detection for PR 7059, Tor Egge fixed this bug.
PR:		7059
1999-04-13 12:43:55 +00:00
Tor Egge
c4e5a8a8b9 During variable expansion, the internal representation of the expression
might be relocated.  Handle this case.
PR:		7059
1999-04-13 04:13:09 +00:00
Martin Cracauer
4c1b08b3bb Fix typo in source-explaining comment. 1999-04-12 15:23:27 +00:00
Martin Cracauer
9d5efc1507 Add a guarded abort() for the problem in PR bin/7059 (no fix so far,
this is hairy).

Reformat this file to comply to style(9). It had mixed styles before.

PR:		bin/7059
1999-04-12 14:23:36 +00:00
Tor Egge
8b220a611d When a variable expansion is enclosed in double quotes, the internal
representation of the expression is quoted.  Take care of this when
doing pattern matching in conjunction with trimming.

	#!/bin/sh
	c=d:e; echo "${c%:e}"

PR:		NetBSD PR#7231
Noticed by:	Havard Eidnes <Havard.Eidnes@runit.sintef.no>
1999-04-09 15:23:48 +00:00
Peter Wemm
3d28e3ed4e Update p_flags doc. 1999-04-06 03:18:57 +00:00
Peter Wemm
4a40c5e7ee Look at p_lock instead of P_NOSWAP etc as an indicator of unswappability.
(While here, put a #ifndef pgtok around the macro that gets a redefinition
 warning)
1999-04-06 03:17:57 +00:00
Martin Cracauer
4487495433 In interactive shells, break loops to the topmost level when a child
is killed by a signal.

(In non-interactive shells - that means a shellscript - the shell just
exits, this was already working)

PR:		bin/9173
1999-04-03 12:55:51 +00:00
Martin Cracauer
b8ec435e6b Implement -a flag. A test shell script can be found at
http://www.cons.org/cracauer/download/sh-interrupt/testsuite/test_export.sh
The PR also had test cases the new version passes.

Fix typo in comment.

PR:		bin/1030
1999-04-03 11:41:46 +00:00
Martin Cracauer
2870f7a83c -T was missing in the synopsis line.
Submitted by:	BDE
1999-04-02 09:28:00 +00:00
Bill Paul
bb22740673 On FreeBSD/alpha, ps(1) does not correctly report process start times
and CPU runtime because it can't access the user area via /proc/<pid>/mem.
This is because the uarea is not mapped into the process address space
at USRSTACK on the alpha like it is on the x86.

Since I'm haven't been able to wrap my brain around the VM system enough
to be able to figure out how to achieve this mapping, and since it's
questionable that such an architectural change is correct, I implemented
a workaround to allow ps(1) to read the uarea from /dev/kmem using
kvm_read() instead of from the process address space via kvm_uread().
The kludge is hidden inside #ifdef __alpha__/#endif so as not to impact
the x86. (Note that top(1) probably uses this same gimmick since it works
on FreeBSD/alpha.)

Reviewed by: dfr
1999-04-01 14:45:18 +00:00
Martin Cracauer
c1c72a3c2a The immediate execution of traps I introduced in September 1998 (to
make /etc/rc interruptible in cases when programs hang with blocked
signals) isn't standard enough.

It is now switched off by default and a new switch -T enables it.

You should update /etc/rc to the version I'm about to commit in a few
minutes to keep it interruptible.
1999-04-01 13:27:36 +00:00
Brian Somers
71405fb6b3 sh doesn't support <> redirections.
PR:	7325
1999-03-31 21:02:01 +00:00
Brian Somers
269dfbee64 Support seconds with -v.
PR:		6308
Submitted by:	Max Euston <meuston@jmrodgers.com>
1999-03-09 09:38:54 +00:00
Jordan K. Hubbard
0e8f2d6c1a Don't emit usage() message when no arguments given to -f. This
appears to be consistent with other Unixen, like Solaris.

PR:		10240
Submitted by:	jun_sun@hlla.is.tsukuba.ac.jp
1999-02-25 22:18:08 +00:00
Bill Fenner
13ca3c01ec Clean up some .Os macro uses: quotes are not needed, multiple arguments
don't really work if the first one isn't "FreeBSD", and "FreeBSD-Experimental"
isn't an OS name.
1999-02-15 08:34:14 +00:00
Alexander Langer
43d1df332e Removed occurrences of consecutive repeated words (such as "the the"). 1999-02-12 02:12:08 +00:00
Garrett Wollman
bd98a81593 Fix synopsis to match 1003.2. Add text describing the way in which
our implementation does not meet 1003.2 (rather than the now outdated
``is expected to comply' language).
1999-01-28 17:41:02 +00:00
Julian Elischer
88c5ea4574 Enable Linux threads support by default.
This takes the conditionals out of the code that has been tested by
various people for a while.
ps and friends (libkvm) will need a recompile as some proc structure
changes are made.

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-26 02:38:12 +00:00
Daniel O'Callaghan
fd5a0a9b4b Example "19%y" changed to "%Y" to discourage poor usage. 1999-01-13 07:01:07 +00:00
Julian Elischer
d8c85307b2 Re-enable the options in ps(1) that were disabled with the Linux
threads support.

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-13 03:11:43 +00:00
Julian Elischer
6626c6045c Reviewed by: Luoqi Chen, Jordan Hubbard
Submitted by:	 "Richard Seaman, Jr." <lists@tar.com>
Obtained from:	linux :-)

Code to allow Linux Threads to run under FreeBSD.

By default not enabled
This code is dependent on the conditional
COMPAT_LINUX_THREADS (suggested by Garret)
This is not yet a 'real' option but will be within some number of hours.
1998-12-19 02:55:34 +00:00
Joseph Koshy
c83e7c5041 Add references to test(1) and expr(1). 1998-12-18 03:51:18 +00:00
Joseph Koshy
e5bf7bf46c Add cross-references to test(1) and expr(1) respectively.
PR: 		docs/9111
Submitted by:	Josh Gilliam <josh@quick.net>
1998-12-18 03:16:47 +00:00
Peter Wemm
dd4cdf587c Cleaning out old stuff from one of my source trees:
use mkdtemp() rather than mktemp() and fix a trivial memory leak.
1998-12-16 05:29:09 +00:00
Warner Losh
a207266e91 Free memory from setmode.
Obtained from: OpenBSD
1998-12-16 04:45:35 +00:00
Warner Losh
0fd975510f Use getcwd in stead of using getwd so that we try harder to avoid
overflowing a buffer.

Obtained from: Either OpenBSD or a discussion in bugtraq.
1998-12-16 04:44:32 +00:00
Warner Losh
a4324714a9 Free memory obtained from setmode.
Obtained from: OpenBSD
1998-12-16 04:42:33 +00:00
Bruce Evans
d3f062f04e Don't put compiler warning flags in leaf Makefiles. 1998-12-07 12:50:48 +00:00
Bruce Evans
ed334a37cd CFLAGS+= -Wall -Wformat for all of src/bin. All warnings except 2 minor
ones in rmail have been fixed.
1998-12-07 12:44:12 +00:00
Bruce Evans
f58a6c7a68 Fixed printf format errors. 1998-12-07 12:37:11 +00:00
Bruce Evans
3b53d3803e Fixed warnx format errors in printf and csh, and snprintf format errors
in sh, by using separate macros for the 1, 2 and 3-arg calls to warnx.
(The 3-arg warnx macro in sh/bltin/bltin.h used to require bogus dummy
args.)
1998-12-07 12:14:04 +00:00
Bruce Evans
b98f433d36 Fixed -Wall regression (broken in rev.1.12). Removed unused includes. 1998-12-07 10:25:48 +00:00
Bruce Evans
9776f3dbad Fixed printf format errors (new bugs in rev.1.7). Fixed a spelling error
(rev.1.7 blew away most of rev.1.2-1.6; I'm only fixing blowing away of
rev.1.4).
1998-12-07 10:16:58 +00:00
Archie Cobbs
fa146c5335 Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]). 1998-12-06 22:58:23 +00:00
David E. O'Brien
f46ecf8bc9 Rev 1.13 fixes PR bin/8958 1998-12-06 05:49:29 +00:00
David E. O'Brien
f08c1d5e48 There is a bug in /bin/pax -s option processing. The code assumes that all
pattern matches will occur at offset zero of the source string.  The bug causes
the input source string pointer to be incremented by the offset of the end of
the match, instead of it's length.  The fix is to only increment the pointer by
the length of the pattern match (eo-so).

Of course, the one example in the man page shows a situation where the match
occurs at offset 0.

Submitted by:	John W. DeBoskey <jwd@unx.sas.com>
Obtained from:	freebsd-current@freebsd.org
1998-12-05 10:29:10 +00:00
Bill Fumerola
0bd063bcd3 Fix typo. "If the an entry" --> "If an entry"
PR:		docs/8140
Submitted by:	Sue Blake <sue@vedanix.welearn.com.au>
1998-12-02 23:20:11 +00:00
Bill Fumerola
969385c1d5 superceded -> superseded, which after some debate on #FreeBSD is in
fact the proper spelling.

PR:		docs/8697
Submitted by:	Sascha Blank <blank@fox.uni-trier.de>
1998-11-30 23:05:38 +00:00
Bill Fumerola
d234f408fe changable -> changeable
PR:		docs/8697
Submitted by:	Sascha Blank <blank@fox.uni-trier.de>
1998-11-30 22:56:44 +00:00
Bruce Evans
7d159f8837 Describe `bs=n' more precisely. Fixed some English errors.
Obtained from:		OpenBSD
1998-11-29 13:54:20 +00:00
Doug Rabson
eb235b13c7 Fix formatting of %CPU value on alpha.
Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-11-25 09:34:00 +00:00
Jordan K. Hubbard
f21a1a1015 Indicate that the thing not found was not /bin/pwd but rather $CWD (or .). 1998-11-21 08:45:22 +00:00
Bruce Evans
40fc4ee2de Don't use mmap() for non-regular files, since st_size is only meaningful
for regular files.  This fixes recent breakage of cp'ing from /dev/zero.
/dev/zero doesn't support mmap(), but the device driver mmap routines are
not called for mapping 0 bytes, so the error was not detected.  mmap()
can't even be used for cp'ing special files that support mmap(), since
there is general way to determine the file size.
1998-11-18 11:47:45 +00:00
Wolfram Schneider
146726f36f Use mmap for file coping. 5-10% faster than the read system call. 1998-11-14 23:43:11 +00:00
Mike Smith
e45520f76e Fix behaviour for 'mkdir -m 777 / /tmp/foo'. Play "guess the style bug"
with Bruce again.

Reported by:	bde
1998-10-23 06:28:40 +00:00
Mike Smith
16c0b5195c Honour the spirit rather than the implementation of the previous changes;
if we are invoked with -m, use chmod() on the final directory component
in order to ensure the mode is correctly set.
1998-10-22 21:42:20 +00:00
Mike Smith
37a182e2b2 Make this compile, and honour the spirit of the original design while
incorporating the intended fix.  Attempt to address some of the
putative style bugs introduced.  Others doubtless remain.

Embarrassed by: bde
1998-10-20 08:04:15 +00:00
Mike Smith
2426ecdfa2 - mkdir -m should call chmod because the high-order bits get ignored
by the kernel as a security feature of some sort.

Submitted by:	Wilfredo Sanchez <wsanchez@apple.com>
1998-10-20 06:37:01 +00:00
Mike Smith
4757e52686 - Fix off-by-one problem in tar where filenames of length 100
and dirnames of length 99 don't archive.

Submitted by:	Wilfredo Sanchez <wsanchez@apple.com>
Obtained from:  OpenBSD
1998-10-20 05:52:33 +00:00
Dag-Erling Smørgrav
1fd98d7d88 Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR:		Loosely related to bin/8252
Approved by:	jkh and bde
1998-10-13 14:52:33 +00:00
Dag-Erling Smørgrav
0ffc35a465 Doh. What was I smoking when I wrote this?
PR:		bin/8301
Submitted by:	Tetsuya Furukawa <tetsuya@secom-sis.co.jp>
1998-10-13 12:19:31 +00:00
Joseph Koshy
22f6653381 Correct a grammatical nit and remove ambiguity about the effect of
the -p option.

PR:		8229
Submitted-by:	Sheldon Hearn <axl@iafrica.com>
1998-10-13 08:52:29 +00:00
Mark Murray
bacda65d14 Add JKH's auth.conf-file parser to turn Kerberos on/off in userland. 1998-10-09 06:31:45 +00:00
Jordan K. Hubbard
9a54dc6faf Null commit, just to test something. Please ignore. 1998-10-04 00:41:08 +00:00
Alexander Langer
f97fe12243 Added missing #include <string.h> 1998-10-03 16:29:59 +00:00
Kenneth D. Merry
c8c7ba2b9a Fix 'chio params' so that it actually prints out the current picker.
(This was broken when the volume tag changes went in.)

Submitted by:	Josef Karthauser <joe@pavilion.net>
1998-10-01 23:30:14 +00:00