Commit Graph

146 Commits

Author SHA1 Message Date
nate
de358b5139 Fix possible FS corruption caused by extra parameter to pax.
oo
Turns out, it's pretty important if you use PAX for backup.  In the man
page for PAX, there is an error (OK, we could call it a "potentially
catastrophic incompleteness").  It reads:

>  The command:
>
>      pax -r -v -f filename
>
>  gives the verbose table of contents for an archive stored in filename.

Yup, it does do that.  With a side effect: it also _replaces_ all the
files that come in from the archive.  As is my custom, I did my
backup-validation real soon after the backup was written.  Precisely
because I've seen the same sort of thing happen on other systems.  So all
that file-restoring didn't do a lot of damage.  Probably helped my
fragmentation somewhat (aha, an online defragger?) It did confuse one
hapless user, who lost an email message he _knew_ he hadn't deleted.
Apparently the system restored the file as of just before that critical
message came in.

The correct entry should read:

>  The command:
>
>      pax -v -f filename
>




>  gives the verbose table of contents for an archive stored in filename.


Submitted by:	John Beckett <jbeckett@southern.edu> via the BSDI mailing list
1995-08-16 23:12:25 +00:00
joerg
1d402e8a8d The command to `move' across file system boundaries is actually
cp -PRp source_file destination

Closes PR # bin/689: mv(1) manpage

Submitted by:	wosch@cs.tu-berlin.de (Wolfram Schneider)
1995-08-15 19:44:39 +00:00
joerg
4f47bf958d sh(1) incorrectly ignored an EOF condition when looking for the
closing backquote in a `foo` substitution.

Discovered by: Martin Welk <mw@theatre.pandora.sax.de>
1995-08-11 08:18:39 +00:00
ache
015e766f81 Fix csh to determine event number properly, i.e. stop by ^*-% too.
This fix match with what manpage said and other systems csh's do.
Submitted by: Bill Fenner <fenner@parc.xerox.com>
1995-08-10 05:13:42 +00:00
ache
36623ef62d Change ctime to strftime %c to use national date/time representation 1995-08-08 00:03:04 +00:00
wollman
fc1f6c1d76 Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
1995-08-07 19:17:46 +00:00
joerg
5eb9106466 Fix /bin/sh's broken handling of the builtin getopts(1). The options
``-ffoo'' and ``-f foo'' have been treated differently.

This has been in violation of Posix.2 (that deprecates -ffoo, but
doesn't disallow it).
1995-08-06 19:35:33 +00:00
ache
5ec1f8dfb4 Use %+ to print data using LC_TIME 1995-08-05 23:08:17 +00:00
joerg
3e48994129 expr(1) didn't comply to Posix.2 and its own man page: any
comparisions have been made as string comparisions, even in cases
where both operands clearly qualified as integers.

The fix is to make the parser properly analyzing whether an operand is
a valid integer or not.
1995-08-04 17:08:07 +00:00
rgrimes
3fc7894a0e Set NOSHARED=true, having this binary static makes it much easier to
fix /usr/lib/*.so problems.

Submitted by:	davidg
1995-07-24 01:44:17 +00:00
ache
56b16b74bf Move first PATH initialization after sensing for interactive,
first relative path warning was disabled in old case
1995-07-07 23:14:36 +00:00
ache
bd0186909e Do the same check for interactive shell (PATH warning)
like in csh.c
1995-07-07 23:13:11 +00:00
ache
8656368e5c Produce importpath warning only for true interactive shells,
close PR 598
1995-07-07 22:45:26 +00:00
bde
23f9d789cd Improve the recently changed and an old error message: don't report probe
errors.
1995-07-04 08:16:32 +00:00
joerg
fa02ebb9a1 stty fails with a non-obvious error message if it's run on a non-tty
stream, such as a rsh or vi pipeline.

The error message is:
stty: TIOCGETD: Operation not supported

It's immediately obvious to the knowledgable hacker type, but not
exactly comforting to the user who's not native to unix.  It's
especially confusing if there's a stty command in their .cshrc and
it's showing up on rsh output.

(Fixes PR #bin/573)

Submitted by:	peter@haywire.dialix.com (Peter Wemm)
1995-07-02 08:54:27 +00:00
bde
f0ca90235f Improve the handling of large minor numbers:
cpio/copyout.c:
Don't output a file if the major, minor or totality of its rdev would be
truncated.  Print a message about the skipped files to stderr but don't
report the error in the exit status.  cpio's abysmal error handling doesn't
allow continuing after an error, and the rdev checks had to be misplaced
to avoid the problem of returning an error code from routines that return
void.

pax/pax.h:
Use the system macros for major(), minor() and makedev().

pax already checks _all_ output conversions for overflow.  This has the
undesirable effect that failure to convert relatively useless fields
such as st_dev for regular files causes files not to be output.  pax
doesn't report exactly which fields couldn't be converted.

tar/create.c:
Don't output a file if the major or minor its rdev would be truncated.
Print a message about the skipped files to stderr and report the error
in the exit status.

tar/tar.c:
For not immediately fatal errors, exit with status 1, not the error count
(mod 256).

All:
Minor numbers are limited to 21 bits in pax's ustar format and to 18
bits in archives created by gnu tar (gnu tar wastes 3 bits for padding).
pax's and cpio's ustar format is incompatible with gnu tar's ustar
format for other reasons (see cpio/README).
1995-06-26 06:24:48 +00:00
ache
dac9b56c4e Additionly print strerror(errno), when getwd() fails to start
in initial directory.
Obtained from: idea from NetBSD
1995-06-18 14:34:48 +00:00
ache
4ceec44820 Fix error:
which /bin/ls
.//bin/ls
Obtained from: NetBSD
1995-06-18 14:20:16 +00:00
ache
b47fb59bab When filec active, TCSANOW was used in any case instead of
sensing TCSADRAIN/TCSAFLUSH
Obtained from: NetBSD
1995-06-18 14:08:44 +00:00
bde
0368f74e33 Don't unlink the target file if the copy failed. This behaviour isn't
documented and is incompatible with gnu cp.  It has very few good effects
(it recovers some disk space) and many bad ones:
- special files are unlinked after certain errors.
- the data may not be recoverable if the source is a special file or fifo.
- unlinking destroys the target attributes as well as the target data.
- unlinking doesn't actually remove the target data if the target is multiply
  linked.
1995-06-14 05:41:27 +00:00
rgrimes
a14d555c87 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
rgrimes
1888033949 Remove trailing whitespace.
Reviewed by:	phk
1995-05-30 00:07:29 +00:00
ache
a682acd0f3 Describe -m option 1995-05-06 13:52:29 +00:00
adam
495fdcd35d typo there --> their 1995-05-05 16:49:15 +00:00
dg
0011fb1aae From "Philippe Charnier" <charnier@lirmm.fr>:
There is a bug in sh: the built in command "fc -l" generates
a core dump (*NULL in not_fcnumber).

According to the sh manual page (fc  -l [-nr] [first [last]]), fc -l
is a correct sequence (in that case, values are defaulted to -16 and -1)
but fails when first is not given.
1995-05-05 06:34:13 +00:00
bde
c6d77acc43 Support nonstandard (not yet all supported) flow control options. `ctsflow'
and `rtsflow' are the components of `crtscts'.  `dtrflow' and `dsrflow' are
new and not yet supported.  `dtrflow' may be useful for Cyclades serial
careds, which have h/w support for it and no h/w support for `rtsflow'.

print.c:
Report NTTYDISC in case the line is in this obsolescent state.
1995-04-29 15:17:17 +00:00
bde
09fc806063 Fix stty' on the output of stty -g'. The changes for the gfmt1 option
weren't TIOCSETD'd  unless another option changed something.
1995-04-29 15:00:34 +00:00
ache
25297a97a8 Fix bugs:
cchars2 not used
can't set or report MIN or TIME == 255
TIOCSETD on wrong fd
PPPDISC is not reported
1995-04-28 19:29:30 +00:00
dg
b824780548 Install with default BINOWN (as it once used to be). 1995-04-15 03:31:19 +00:00
dg
b0ecb5429e Install setgid kmem rather than setuid root. The problem with procfs that
was breaking this before has been fixed.
1995-04-15 03:25:52 +00:00
ache
bf4c9aa148 Allow root to delete uchg/uappnd files 1995-04-13 13:35:09 +00:00
joerg
1fa4f508ae date(1) didn't emit a final newline if the format had been specified
with `+'.  This breaks tradition and violates Posix 1003.2.

Discoverd by: luigi@labinfo.iet.unipi.it (Luigi Rizzo)
1995-04-03 20:08:33 +00:00
bde
cb1457c9ad Add braces to fix wrong if-if-else-if nesting that broke `cp -pR' for
fifos.
1995-04-02 00:49:16 +00:00
phk
183b7355f6 Make build work, even if there is no obj subdir. 1995-03-30 19:45:20 +00:00
phk
d42111863a Having BLOCKSIZE=K and using "-k" option ls would use 2K block size... 1995-03-23 19:05:00 +00:00
joerg
c6030c6511 You will find enclosed some changes to make gcc -Wall more happy in
/usr/src/bin. Note that some patches are still needed in that directory.

I (Joerg) finished most of Philippe's cleanup.  /bin/sh will still
need *allot* of work, however.

Submitted by:	charnier@lirmm.fr (Philippe Charnier)
1995-03-19 13:29:28 +00:00
dg
612646eb4c Fix previous fix that removes an unnecessary space; the output is now
just like it was in 1.1.5.
1995-03-09 20:40:17 +00:00
jkh
1d346f4dd3 Allow 0 as a signal number to match the man page.
Noticed by:	Mike Murphy <mrm@Sceard.COM>
1995-03-05 21:52:41 +00:00
joerg
a732676a92 Use `interactive' (foreground) delivery by default. The old behaviour
of queuing mails only can be restored by uncommenting a CFLAGS+= line
in the makefile, so sites that _really_ need this (perhaps some huge
mail hubs) can still have it.  The majority of FreeBSD boxes is better
served with an immediate delivery (and last time i've been asking on
the list, nobody complained).
1995-03-05 08:27:14 +00:00
guido
a28e8018c8 Fix the deletion of trailing newlines with backquote expansion.
Reviewed by:
Submitted by:
Obtained from:
1995-03-01 13:04:15 +00:00
jkh
1323b9b07e 1000000 usec -> 1 sec 0 usec; fix.
Submitted by:	"Philippe Charnier" <charnier@lirmm.fr>
1995-02-16 09:17:27 +00:00
bde
df0c70091b Include <limits.h> to get the definition of INT_MAX - don't depend on
namespace pollution in <time.h>.
1995-02-03 22:21:09 +00:00
dg
dd92b57647 Fix bogus format string; fixes problem reported by Wolfram Schneider. 1995-01-25 07:31:01 +00:00
ache
5887fd95f0 More koshering [ul]case fix, don't use pre-initialized tables at all,
treat 0xFF as valid character.
1995-01-17 23:04:29 +00:00
ache
eb022aca1e Make conv=[lu]case works with localized ctype (8bit) 1995-01-17 22:55:59 +00:00
ats
c24e685c76 Submitted by: David Muir Sharnoff
domainame has referenced getdomainname(2) instead of getdomainname(3).
bug report docs/137.
1995-01-14 17:02:33 +00:00
alm
a8457251d8 fixed `s' to set dot to last line affected, not the last line in
a substitution range.
1995-01-14 11:47:16 +00:00
paul
5c96f27c9c What I think is a more correct fix for the handling of backslashes
inside backquotes. Reversed my previous fix.
1995-01-11 07:07:00 +00:00
paul
27f1f0b76a Fix a bug with handling backslash escapes inside some quotes.
Should solve our problems with edit-pr.
1995-01-09 20:00:54 +00:00
bde
b4e68b2cf5 Don't strip off the last slash in the pathname "/". cp used to
stat the pathname "" in order to decide that the pathname "/" is
a directory.  This caused `cp kernel /' to fail if the kernel has
the POSIX behaviour of not allowing the pathname "" to be an alias
for ".".  It presumably also caused `cp /etc/motd /' to fail in
the unlikely event that "." is not stat'able.

Be more careful about concatenating pathnames: don't check that
the pathname fits until prefixes have been discarded (the check
was too strict).  Print the final pathname in error messages.
Terminate the target directory name properly for error messages.
Don't add a slash between components if there is already a slash.
1994-12-30 13:12:12 +00:00