Commit Graph

1754 Commits

Author SHA1 Message Date
Jun Kuriyama
b800f53d91 o Fix a style bug and poor wording in comment.
o When fts_read() cannot stat the file, it can't be unlinked.  At
  that case, don't display error message when -f flag is used.

Obtained from:	bde
PR:		kern/16815, bin/35842
Reported by:	kuriyama, Aleksandr A. Babaylov <.@babolo.ru>
2004-01-01 10:26:43 +00:00
Maxim Konovalov
8aa55d8126 o Spell 'diretories' correctly.
PR:		misc/60730
Submitted by:	Eugene Grosbein
MFC after:	3 days
2003-12-30 15:39:33 +00:00
Martin Cracauer
bd80d26f3b PR 28852
sh -e behaviour was incorrect when && and || statements where used in
"if" clauses.

This is the patch submitted by MORI Kouji <mori@tri.asanuma.co.jp>.

It fixes the issue at hand, but sh fixes like this are super-hard to
verify that they don't break anything else.  I ran some of my old test
cases and a few big GNU configure scripts that detected mistakes
before, with the previous sh, patched sh and bash.  No differences in
behaviour found.  MFC recommended after longer than usual time.

Compiles on i386 and sledge.
2003-12-28 02:05:12 +00:00
Ruslan Ermilov
887cb17fac Print unambiguous paths with -R -v. 2003-12-16 15:17:30 +00:00
Maxime Henrion
ec912781bb The uuidgen(1) program is WARNS=6 clean, so flag it as such.
Tested on:	i386, sparc64
2003-12-07 21:34:56 +00:00
David E. O'Brien
d5f9f41c7b Do something sensible if both -h and -k are given.
Approved by:	re(scottl)
2003-12-01 19:10:29 +00:00
Marcel Moolenaar
bd8477d623 Force a staticly linked /bin and /sbin for ia64. The necessary changes
to gcc have not been made for ia64, which means that executables still
have /usr/libexec/ld-elf.so.1 as the dynamic linker. This simply does
not work if /usr is a seperate filesystem not mounted when the kernel
tries to execute init(8).

Note that this is a temporary fix until a new gcc has been imported
that does have the required changes.

Approved: re@
2003-11-19 16:59:00 +00:00
Gordon Tetlow
7e83e0de77 Change the default for binaries in /bin and /sbin from statically to
dynamically linked. This has been a long time coming with the move of
critical libraries from /usr/lib to /lib. If you don't feel comfortable
with dynamically linked binaries in your root partition, now is the
time to define NO_DYNAMICROOT in your make.conf.

Approved by:	re
2003-11-16 04:57:28 +00:00
Alan Cox
b9e25f436b Don't mmap(2) and munmap(2) zero-length files.
Submitted by:	Wiktor Niesiobedzki <bsd@w.evip.pl>
2003-11-13 05:26:55 +00:00
Kris Kennaway
ea64ad7727 Fix format strings (intmax_t is %jd, not %qd)
Reviewed by:	tjr
2003-11-12 21:47:42 +00:00
Kirk McKusick
fde81c7d8e Update the statfs structure with 64-bit fields to allow
accurate reporting of multi-terabyte filesystem sizes.

You should build and boot a new kernel BEFORE doing a `make world'
as the new kernel will know about binaries using the old statfs
structure, but an old kernel will not know about the new system
calls that support the new statfs structure. Running an old kernel
after a `make world' will cause programs such as `df' that do a
statfs system call to fail with a bad system call.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Tim Robbins <tjr@freebsd.org>
Reviewed by:	Julian Elischer <julian@elischer.org>
Reviewed by:	the hoards of <arch@freebsd.org>
Sponsored by:   DARPA & NAI Labs.
2003-11-12 08:01:40 +00:00
Guido van Rooij
f3761deee3 When the P flag is set (i.e. Overwrite regular files before deleting them),
do only unlink the file if we could indeed overwrite the file.
Old behaviour: rm -P /tmp/foo (foo mode 0444) would NOT overwrite foo,
but still delete it (with a warning: rm: foo: Permission denied)
New behaviour: Just the EPERM warning, but no deletion

Reviewed by:	bde
2003-11-10 09:40:18 +00:00
Bruce Evans
8f1f433834 1. Fixed leakage of a file descriptor for every non-fatal failure in
rm_overwrite() (for rm -P).

2. Print the file name in the error message for (fatal) malloc() failures
   in rm_overwrite().  I first thought that malloc() failures should be
   non-fatal since they don't prevent proceeding the the next file, but
   making them non-fatal would normally give too much output for rm -Pr
   on a large tree in the unlikely event that even one occurs, since the
   malloc()ed amounts are usually the same.  Just print the file name since
   the malloc()ed amounts are not always the same and it doesn't hurt to
   know where rm was when it quit.

Submitted by:	guido ((1) and original version of (2))
2003-11-08 09:55:16 +00:00
Ruslan Ermilov
3565c6a8e3 Style. 2003-11-02 06:47:39 +00:00
Anton Berezin
ad6a34de1d Remove the code for parsing octal modes, since setmode(3) already
handles them.

Reviewed by:	audit
MFC after:	2 weeks
2003-10-31 13:20:09 +00:00
Tim J. Robbins
c5bc87095b Handle realloc() failure correctly. 2003-10-16 07:07:20 +00:00
Mark Murray
0f66784721 Turn malloc+snprintf into asnprintf.
Submitted by:	David Hill <hill at phobia dot em ess>
2003-10-14 20:42:13 +00:00
Diomidis Spinellis
91b7d6dc58 - Check and report write(2) errors.
- Issue a single writev(2) call instead of multiple write(2)s.
  This change improves the inefficiencies introduced when echo
  went on an stdio diet.

The following figures are for echoing 1000 arguments.
original stdio-based echo:
        0.01 real         0.01 user         0.00 sys
before:
        0.05 real         0.00 user         0.04 sys
after:
        0.01 real         0.00 user         0.00 sys
2003-10-11 20:34:43 +00:00
Diomidis Spinellis
4566e7a433 Check for write errors; report and exit with error value. 2003-10-04 07:16:40 +00:00
David E. O'Brien
be2c4e5415 Be a little bit more correct WRT counting numbers vs. integer numbers. 2003-09-13 20:46:58 +00:00
Jens Schweikhardt
9e4656f7e8 Do not assume there is only a space between #define and the macro name
when grepping for JOBS. The recent style cleanup replaced the space with
a tab and broke job control detection. Little edits, disastrous consequences.

Submitted by:	Peter Edwards <pmedwards@eircom.net>
X-MFC when:	    in about 5 weeks with the other sh arithmetic fixes.
2003-09-13 06:59:22 +00:00
Tim J. Robbins
bc458f6637 Add the -m, -w and -x options to ls's usage message.
PR:		51493
Submitted by:	Walter Belgers
MFC after:	1 month
2003-09-09 12:02:52 +00:00
Ruslan Ermilov
fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
Ruslan Ermilov
7b0ac2826b Don't escape names in MLINKS: this won't work with bsd.man.mk,v 1.53. 2003-09-07 12:52:17 +00:00
Jens Schweikhardt
4fe15b85a6 Fix testing of arith_assign() value for $((a=15)).
Submitted by:	Enache Adrian <enache@rdslink.ro>
2003-09-07 10:14:56 +00:00
Tim J. Robbins
94508dc9c8 #include <string.h> for prototypes for strcpy() and strlen().
Submitted by:	Stefan Farfeleder
2003-09-06 16:33:55 +00:00
Jens Schweikhardt
de7112e1ba Style cleanup, mostly
Requested by:	bde
2003-09-04 18:28:42 +00:00
Jens Schweikhardt
bc411549ba Implement missing shell arithmetic operators in $(()) expansion
and variable recognition.

PR:		standards/52972
Submitted by:	Wartan Hachaturow <wart@tepkom.ru>
Reviewed by:	tjr (improved on original patch)
Tested by:	buildworld on CURRENT.
MFC after:	6 weeks
2003-08-30 12:31:44 +00:00
Gordon Tetlow
442afd046f Stage 4 of dynamically linked root support. Add a big knob,
WITH_DYNAMICROOT, which will toggle the generation of dynamically-linked
binaries for installation in /bin and /sbin. It is currently off,
meaning that /bin and /sbin are still statically linked by default.

If something goes wrong (which I hope doesn't), this is what /rescue is
all about. Please do not try to use WITH_DYNAMICROOT and NO_RESCUE to
save space or some other equally silly reason. If you do and end up
having problems, you have been warned.
2003-08-17 08:37:47 +00:00
Hartmut Brandt
de244df7c9 Implement the nwchan keyword that has been in the man page, but was
not implemented. This is just handy if you want to ddb the address
some process is waiting on.
2003-08-13 07:35:07 +00:00
Jens Schweikhardt
a3c75939e8 Note in STANDARDS that -gno are not (yet?) POSIX conformant.
Spotted by:	harti
MFC after:	3 days
2003-08-08 17:04:17 +00:00
Robert Watson
ea03990629 Add additional documentation to setfacl(1) regarding the behavior of
tools such as chmod(1) and ls(1) when it comes to acting on objects
that have POSIX.1e extended ACLs.  Specifically, discuss the
substitution of the mask entry for the group entry in the mode
representation of the ACL.  Differently worded from the submission,
and could probably use further refinement.

PR:		55319
Submitted by:	Grzegorz Czaplinski <G.Czaplinski@prioris.mini.pw.edu.pl>
2003-08-07 14:52:17 +00:00
Robert Watson
95e367261e -v no longer a valid argument to setfacl(1) -- remove from usage().
PR:		55318
Submitted by:	Grzegorz Czaplinski <G.Czaplinski@prioris.mini.pw.edu.pl>
2003-08-07 14:43:43 +00:00
Christian Brueffer
a54b88d830 Clarify that the 'state' information consists of characters, not
only letters (e.g. IWs+)

PR:		55221
Submitted by:	Rich Morin <rdm@cfcl.com>
MFC after:	3 days
2003-08-05 10:31:28 +00:00
Andrey A. Chernov
508f10f7c1 Remove collate_range_cmp() stabilization, it conflicts with ranges 2003-08-03 04:28:10 +00:00
Mark Murray
ebb9f0efa8 Don't check for the existance of src/crypto/ for building items that
may contain crypto. The days of ITAR paranoia are over, and the simple
macro tests that remain are sufficient.
2003-07-24 18:30:25 +00:00
Ruslan Ermilov
8fe29a4f17 This code isn't WARNS=6 clean in the standard (crypto) case
due to bugs in OpenSSL headers.  I was testing in the wrong
environmement: standalone build without crypto/ sources.
2003-07-20 12:26:24 +00:00
Ruslan Ermilov
ff572a5e73 Make this code WARNS=6 clean again (after GCC 3.1.1 import).
Submitted by:	Marius Strobl <marius@alchemy.franken.de>
2003-07-20 10:24:09 +00:00
Robert Watson
4615eb20c3 When reporting an error internalizing an ACL string, print out the
ACL that generated the error, rather than the function, which is
more user-friendly.

Obtained from:	TrustedBSD Project
Product of:	France
2003-07-18 16:00:26 +00:00
Alexander Kabaev
08cbb1d115 Temporarily turn off -Werror for these components. 2003-07-11 05:24:32 +00:00
Christian Brueffer
d18ff742dc -l prints all permissions, not just owner and group
PR:		54294
Submitted by:	Per Hedeland <per@hedeland.org>
MFC after:	3 days
2003-07-10 20:53:56 +00:00
Gregory Neil Shapiro
dce6e6518b Remove MAINTAINER= lines from individual Makefiles in favor of the
MAINTAINER file (which already had entries for sendmail).
2003-07-07 03:54:04 +00:00
Diomidis Spinellis
2ba1b30bf5 Changes following CScout analysis:
- Removed dead declarations
- Made objects that should have been declared as static, static.

The changes use STATIC instead of static, following the existing
convention in the rest of the code.

Approved by:	schweikh (mentor)
MFC after:	2 weeks
2003-07-05 15:18:44 +00:00
Alexander Kabaev
be0d01f895 Rename a local variable in order to avoid collision with standard 'log'
function.
2003-06-30 17:05:40 +00:00
John-Mark Gurney
529a7167bd pass -1 to setfile in cp.c
Submitted by:	Jun Kuriyama
2003-06-30 06:16:06 +00:00
Gordon Tetlow
6d1b4a4730 Tweak a couple of utilities so they compile cleanly for /rescue. Mostly
path fixes.

Submitted by:	Tim Kientzle <kientzle@acm.org>
2003-06-29 18:46:18 +00:00
Ruslan Ermilov
ce17762f4a Unbreak NOCRYPT buildworld.
Reviewed by:	markm
2003-06-29 10:03:35 +00:00
John-Mark Gurney
a6b05ab6ea support saving both user/group and permissions on symlinks (from PR)
also fix a slight bogon that assumed an fd of 0 was not valid.  Changed
it to be -1.

PR:		bin/25017
Submitted by:	Martin Kammerhofer
2003-06-22 07:02:17 +00:00
Mark Murray
eac4bdcca4 Get this area compiling with the highest WARNS= that it works with.
Obsolete WFORMAT= junk also removed where possible.

OK'ed by:	obrien
Tested on:	sparc64, alpha, i386
2003-06-13 07:04:02 +00:00
Scott Long
48b8c0de5a Add the -H option to ps(1) to display all kernel visible threads in each
process.  The default behavior of showing only the process is retained as
the default.
2003-06-12 16:53:55 +00:00