Commit Graph

488 Commits

Author SHA1 Message Date
Eivind Eklund
1ee36a5be6 It's more portable to use <errno.h> than <sys/errno.h>
Pointed-out-by:	bde (a long while ago)
1997-12-15 20:37:43 +00:00
Eivind Eklund
0c7d8ce5a5 Revert 1.15 - duplicate code (initialization).
Pointed-out-by:	bde
1997-12-15 20:34:52 +00:00
Eivind Eklund
5b421cac1a Make code slightly more robust towards change by calculating size
in-place.

Obtained from:  OpenBSD ar_subs.c rev 1.7 by Tood Miller <millert@openbsd.org)
1997-12-12 18:38:22 +00:00
Eivind Eklund
825856aa2c Make this lint more cleanly
Obtained from: OpenBSD file rev 1.4 by mickey
1997-12-12 18:24:17 +00:00
Eivind Eklund
ca8f21d65c Merge from OpenBSD:
>sprintf -> snprintf paranoia

Obtainted from: OpenBSD src/bin/stty/print.c v1.5
	by Todd Miller <millert@openbsd.org>
1997-12-12 18:11:29 +00:00
Brian Somers
ad1c694bdc Put [+format] at the end of the usage message.
Make `date -?' output (pretty much) the same as
the man page
PR:		5269
1997-12-11 02:38:56 +00:00
Eivind Eklund
007d33500e Remove simultaneous include of <sys/param.h> and <sys/types.h>.
Reorder includes to be alphabetical some places since I already was in
here.
1997-12-10 22:18:54 +00:00
Eivind Eklund
a33d9e6606 Merge from OpenBSD:
> Error out if someone tries to mv a mount point.  Old behavior was to
> move all files contained in the mounted filesystem to the dest. dir
> which could be quite nasty.  Personally, I think rename(2) should
> return EPERM or EINVAL instead of EXDEV.

Obtained from: OpenBSD mv.c rev 1.6 by Todd Miller <millert@openbsd.org>
1997-12-10 17:52:49 +00:00
Wolfram Schneider
ac105a5777 Add -P option to cp(1) for local to local copying.
Pointed out by: bde
1997-12-08 21:02:36 +00:00
Wolfram Schneider
f1f5ba1e4c Use cp -R' instead cp -r' for local to local coping
(e.g.: rcp -r /tmp/1 /tmp/2). See the cp(1) manpage for more details.
1997-12-07 20:49:39 +00:00
Peter Wemm
4b4f0fcd24 Move procctl to the Attic, it's been copied to usr.sbin/procctl as
suggested by bde via sef.
1997-12-07 02:26:23 +00:00
Sean Eric Fagan
a367d57578 Add procctl to the list of programs built. 1997-12-06 04:19:41 +00:00
Sean Eric Fagan
c430992a81 First checkin of the procctl program. 1997-12-06 04:19:09 +00:00
John Dyson
b548141b9b Document the new -f flag.
PR:	5196
Submitted by:	Matt Dillon <dillon@best.net>
1997-12-05 07:35:31 +00:00
John Dyson
3ac5e95583 Add an option to building PS, so that the upages are explicitly paged in only
for users who are root, or in group wheel.  This is useful on large timesharing
systems where a PS command can cause the system to grind to a halt.  The
ability to get the information isn't diminished for those who really need the
additional detail (administrators.)  Normal users won't see any difference unless
the processes are swapped out.  The "really get it mode" is invoked by the
use of an additional flag in the command string "-f".  New/old behavior is
selectable with a compile option.

PR:		5196
Submitted by:	Matt Dillon <dillon@best.net>
1997-12-05 07:33:40 +00:00
Julian Elischer
52bf64c787 Reviewed by: hackers@freebsd.org in general
Obtained from: Whistle Communications tree

Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.
1997-11-13 00:28:51 +00:00
John Polstra
c351e0897e Document the exit status for a command that was terminated by a
signal.
1997-11-12 04:32:50 +00:00
Joerg Wunsch
1898febe2d Sort "sparse" into alphabetical order, since dd's `conv' options need
to be sorted.  This temporarily broke the "osync" option.
1997-11-11 20:35:29 +00:00
Bruce Evans
28701136f7 Fixed some type and value mismatches. setsignal() returned a bogusly
cast value that was always ignored.  Rev.1.9 of trap.c made this
more bogus by returning a semantically different value after calling
siginterrupt().  Avoid these problems by not returning a value.
1997-11-10 11:32:24 +00:00
Andrey A. Chernov
8dd81503df 1) Fix longstanding bug:
trap 'echo xxx' 1 2 3 15
	read x
is not interrupted by ^C (due to restartable read syscall) and must be
interrupted per POSIX
Worse case:
	read -t 5 x
hangs forever after ^C pressed (supposed to timeout after 5 secs)
Fixed by adding siginterrupt(signo, 1) after catch handler installed

2) Do not reinstall sighandler immediately after it is called,
BSD do it for us
1997-11-05 23:33:58 +00:00
Wolfgang Helbig
af6ff02816 Synchronize usage() and man page.
Pointed out by bde.
1997-10-26 10:33:02 +00:00
Joerg Wunsch
80214f046b Style police: keep a variable list in alphabetical order, and add
pointless paren's to return statements.

Nitpicked by:	bde :)
1997-10-13 09:36:05 +00:00
Joerg Wunsch
b8904f2acb Make df(1) exit with non-success status if something went wrong.
PR:		bin/4415
1997-10-12 13:55:43 +00:00
Joerg Wunsch
4ddfeabd8f Teach dd(1) about an option to write sparse files. Can be useful for
things like diskless clients' swap files etc.

Submitted by:	pascal@zuo.dec.com (Pascal Pederiva) (ages ago, with many
						  stylistic changes by me)
1997-10-11 20:09:05 +00:00
Eivind Eklund
f8ce2ec95f Un-clobber mktemp->mkstemp patch. 1997-10-09 11:05:16 +00:00
Eivind Eklund
73db7d72c8 Add <sys/errno.h> 1997-10-09 10:50:54 +00:00
Eivind Eklund
ad0b1f1ac3 make signal handlers errno safe
Obtained from:	OpenBSD (file rev 1.11) - Theo de Raadt <deraadt@openbsd.org>
1997-10-08 14:47:56 +00:00
Eivind Eklund
af6ab81d43 mktemp -> mkstemp
Obtained from: OpenBSD (file rev 1.4 by Theo de Raadt <deraadt@openbsd.org>)
1997-10-08 13:46:39 +00:00
Eivind Eklund
bd6b64117b make signal handlers errno safe
Obtained from:	OpenBSD (file rev 1.5) Theo de Raadt <deraadt@openbsd.org>
1997-10-08 12:59:14 +00:00
Eivind Eklund
4c33974251 Slightly improved fix compared to my insiration
don't munge argv strings -- copy them first. avoids 'w' showing:
    deraadt  p8 zeus.theos.com    8:26AM     3 dd if of bs

Obtained from:	OpenBSD (file rev 1.3) by Theo de Raadt <deraadt@openbsd.org>
1997-10-08 12:10:33 +00:00
Eivind Eklund
186741ecdb save errno in sigchld handler
Obtained from:	Theo deRaadt <theo@openbsd.org> (OpenBSD rev 1.6)
1997-10-07 16:43:16 +00:00
Eivind Eklund
ea3a01d31d vsprintf -> vnsprintf paranoia.
Obtained from:	Todd Miller <millert@openbsd.org> (OpenBSD rev 1.3)
1997-10-07 16:33:22 +00:00
Eivind Eklund
13a71f5d9b Don't honor $HOME if >= MAXPATHLEN
Obtained from:	Todd Miller <millert@openbsd.org> (OpenBSD csh.c rev 1.3 and 1.4)
1997-10-07 16:27:48 +00:00
Jordan K. Hubbard
97fe7f477f Changes to support full make parallelism (-j<n>) in the world
target.
Reviewed by:	<many different folks>
Submitted by:	Nickolay N. Dudorov" <nnd@nnd.itfs.nsk.su>
1997-10-05 09:40:24 +00:00
Wolfram Schneider
ae691257b7 mv(1) is too silent if used with the option -i. It should
print which input mv(1) expect (y/n) and print a warning if the
file was not overwritten.
1997-10-04 13:02:06 +00:00
Wolfram Schneider
ab215c6703 cp(1) is too silent if used with the option -i. It should
print which input cp(1) expect (y/n) and print a warning if the
file was not overwritten.
1997-10-03 18:11:14 +00:00
Wolfram Schneider
f50f7e1e32 Change example from US to international standard date notation. 1997-10-03 18:09:17 +00:00
Daniel O'Callaghan
c5c1c13516 Back out suppress '\n' mod. 1997-10-03 12:54:30 +00:00
Daniel O'Callaghan
34de7199ea Add the '-s' flag to the usage string. 1997-10-01 05:44:35 +00:00
Daniel O'Callaghan
70a53cd743 Add the ability to supress the '\n' at the end of the date printed. 1997-10-01 05:24:08 +00:00
Joerg Wunsch
adb7f7bca7 Fix the broken `date HHMM.SS' handling.
PR:		bin/4661
Submitted by:	blank@sliphost37.uni-trier.de (Sascha Blank)
1997-09-30 20:06:15 +00:00
Mike Smith
afa53c8df7 Add the '-t timeout' option to the 'read' builtin. This allows the
'read' command to return an error if the user fails to supply any
input withink a given time period.  The behaviour of this option is
similar to that of the like-named option in ksh93.

Reviewed by:	joerg
1997-09-29 15:15:16 +00:00
Wolfram Schneider
fee9ad97d6 Endless loop.
$ touch from to
$ echo -n loop | mv -i from to
overwrite to?
^C
1997-09-28 10:41:40 +00:00
Mark Murray
8a7ad3adf7 Change to use the new KTH Kerberos.
Also make -Wall a bit quieter.
1997-09-28 08:32:59 +00:00
Philippe Charnier
34384756cd environmental -> environment. 1997-09-18 06:55:21 +00:00
Sean Eric Fagan
51f26ac519 Fix sorting of directories when doing '-d'.
PR:		bin/4558
Submitted by:	Keith Bostic
1997-09-18 06:42:27 +00:00
Wolfram Schneider
c7a197e1d8 PR: docs/4449
The -c flag is not documented in the sh(1) manapge.

Submitted by: adrian@virginia.edu
1997-09-13 17:40:00 +00:00
Wolfram Schneider
f6b31571f6 spelling corrections.
PR: docs/4450
Submitted by: josh@quick.net
1997-09-13 16:01:53 +00:00
Jordan K. Hubbard
f9fc03961c This command doesn't need to be setuid root, it's only asking
for potential trouble.
Reviewed by:	security officers.
Noted by:	OpenBSD
1997-09-12 15:00:06 +00:00
John-Mark Gurney
e3d79adaba fix misspelling
Submitted-by: Josh Gilliam

Closes PR:4427
1997-08-30 11:09:26 +00:00