Commit Graph

1230 Commits

Author SHA1 Message Date
peter
a066ea9800 For the -delete option, emulate the behavior of "rm -f" when dealing with
user-immutable files.

Requested by: ache
1996-10-05 18:21:05 +00:00
ache
89c99ff0c6 Fix Moscow timezone rule 1996-10-05 09:03:37 +00:00
peter
8b748f9115 Fix the previous commit. The second of the 8-character columns was
a duplicate of the first column of 8...
1996-10-04 23:29:38 +00:00
peter
342c1e0794 Implement a -delete option to find. The code is extremely paranoid and
goes to a fair degree of trouble to enable something like this to
be safe:  cd /tmp && find . -mtime +7 -delete

It removes both files and directories.  It does not attempt to remove
immutable files (an earlier version I showed to a few people did a chflags
and tried to blow away even immutable files.  Too risky..)

It is thought to be safe because it forces the fts(3) driven descent to
only do "minimal risk" stuff.  specifically, -follow is disabled, it does
checking to see that it chdir'ed to the directory it thought it was
going to, it will *not* pass a pathname with a '/' character in it to
unlink(), so it should be totally immune to symlink tree races.  If it runs
into something "fishy", it bails out rather than blunder ahead.. It's better
to do that if somebody is trying to compromise security rather than risk
giving them an opportunity.  Since the unlink()/rmdir() is being called
from within the current working directory during the tree descent, there
are no fork/exec overheads or races.

As a side effect of this paranoia, you cannot do a
"find /somewhere/dir -delete", as the last argument to rmdir() is
"/somewhere/dir", and the checking won't allow it.  Besides, one would use
rm -rf for that case anyway. :-)

Reviewed by: pst (some time ago, but I've removed the immutable file
deletion code that he complained about since he last saw it)
1996-10-04 12:54:07 +00:00
jfieber
ae0689930a When starting HTML generation, remove any pre-existing link file. 1996-10-01 16:23:39 +00:00
peter
dd85f245b6 When used as a shell builtin, this program decoded a subset of arguments
known to printf(3) and then used printf() to format it... The only
problem what the #define printf out1fmt.  The code was behaving differently
when run as a shell builtin since out1fmt() isn't printf(3).

Simple hack.  Print to a buffer and fputs (also #defined for sh) the
result.  This should fix the printf builtin problem in PR#1673, rather
than leaving the call commented out.  (printf.o was being statically linked
in anyway, we might as well use it)
1996-10-01 04:56:59 +00:00
imp
ffedaf5fae Sync usage line to man page, per style(9).
Pointed out by: Bruce Evans <bde@zeta.org.au>
1996-10-01 03:59:57 +00:00
peter
519e9b0911 Incorporate John Polstra's sods.c display of the details about the
dynamic linking information in the executable.  It's quite extensive.
It's connected to ldd's (new) -v option.
1996-10-01 02:16:16 +00:00
peter
7ad318175d Support for specifying printf-like output specs to control the ldd output
as present in the new rtld version.

Obtained from: NetBSD
Reviewed by: nate, jdp
1996-10-01 01:34:32 +00:00
imp
d4e55ffaf3 Submitted by: Bruce Evans
Remove -S for the install usage message
Make the install usage message < 80 columns wide
Place the dodir declaration in order.
1996-09-29 23:09:51 +00:00
jfieber
4c255f1f69 Add a signal handler to clean up files if an INT, HUP, or QUIT
is received.
1996-09-29 19:42:51 +00:00
bde
3d1181fd33 Include <fcntl.h> so that this doesn't depend on the KERNEL version
of <sys/file.h> including <sys/fcntl.h>.  Only the !KERNEL version
of <sys/file.h> will do that when I unspam the kernel headers.
1996-09-29 19:25:10 +00:00
jfieber
07acb1312b Remove some stray debugging code. 1996-09-29 18:27:12 +00:00
jfieber
20976a3391 Change the behavior of the -links option. Instead of actually
creating a symbolic link from foo.html (from <label name="foo">) to
the numbered file, a shell script is built that can be used to make
the links at a later time (read: after installation in the target
directory).
1996-09-29 17:34:05 +00:00
imp
7cb3462826 Implement -d in install. Update the man page to reflect this change. 1996-09-29 06:29:54 +00:00
joerg
f811c2ec39 Now that we've already got "hexdump -C", make calling the command "hd"
having the same effect, and install a link for this.  There is
historic precedence for the command hd(1) (with roughly that output
format) in Xenix, SCO, and a few SysV's that tooks the idea.

Also, added a couple of spaces to the -C format to make the output
better readable.

Ok'ed by: phk
1996-09-29 04:17:24 +00:00
wosch
ee17503232 .Os NetBSD -> .Os FreeBSD.
The pages are not NetBSD specific and FreeBSD is not a child of NetBSD.
1996-09-28 22:46:35 +00:00
joerg
8d0e25e335 Various cleanups:
. prototyped and staticized the internal functions while i was here,
. made the thing -Wall clean,
. fixed an error that causes the recipient name to be matched only
  for the first characters, as opposed to a full name (wonder why i'm
  concerned?  Well, one of my login IDs is `j', and i've noticed that
  vacation has been sending out replies to all mailing list messages
  that had a jkh@ or jmb@ in it :),
. introduced an option -l to list the contents of the database; mucho
  useful if you've got (too) many mailing list messages in your inbox
  and wanna make sure you don't miss the `important' mails.
1996-09-28 13:37:38 +00:00
bde
8dd1904c30 Eliminated NOFILE. Use the arbitrary (currently identical) limit of 64
instead (for the input stack size).

`mail' was one of the 3 programs in /usr/src that (mis)used NOFILE.
1996-09-28 13:15:06 +00:00
imp
f558febd81 Use EX_* exit values, from NetBSD 1996-09-28 02:53:45 +00:00
andreas
c70c65cc5d Added magic file for bzip in ./Magdir
Obtained from: bzip sources ;)
1996-09-27 21:57:12 +00:00
steve
b9bf5744b2 Fix for PR# 1231, make(1) execution of ``.BEGIN'' does
not halt on error.  Thanks to Wolfram for reminding me. ;)

Also remove a unnecessary test for c == '\n', since the
loop (in ParseSkipLine) will not terminate unless
c == '\n' || c == EOF, and the EOF case is already
explicted handled by a return statement.
1996-09-25 02:55:49 +00:00
bde
a0082297a8 Changed 'd' to 'D' in getopt arg too. 1996-09-24 17:29:42 +00:00
peter
4c88ad3be8 Drat, had the N_FN overloading based on N_EXT backwards. N_EXT = filename,
no N_EXT is a "warning". eg:
% nm -p /tmp/gets.o
...
00000000 w  warning: this program uses gets(), which is unsafe.
         U  _gets
00000000 T  _gets
1996-09-24 15:56:26 +00:00
peter
142a5685e6 Rudimentry support for viewing weak symbols. There are two types that
this deals with, the N_INDR indirect symbols done with .stabs operations,
and those done with .weak that have an extra field in n_other.
1996-09-24 09:59:43 +00:00
bde
86c863abe8 Really eliminated includes of the "temporary" backwards compatibility
header <sys/dir.h> in applications.  My previous sweep didn't find the
places that included it without needing it.
1996-09-24 08:43:04 +00:00
bde
d2512c2bf9 Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications.  Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.
1996-09-24 08:08:11 +00:00
imp
eea77f0b8b Per discussions in -current
- Change the debug flag from -d to -D to avoid conflict with other
	  install programs.
	- Update man page to reflect this
	- Update usage string
-d meaning creat directory is specifically not implemented by these changes.
1996-09-24 04:15:02 +00:00
wosch
89dea7c61d add missing comma(s) in .Xr macros 1996-09-23 22:24:39 +00:00
steve
9b222d6b6a Be sure to remove any newlines encountered when
parsing the input file in ParseSkipLine(...).
1996-09-23 17:21:34 +00:00
phk
880849a80e Remove length field from utrace entries. 1996-09-22 18:18:20 +00:00
steve
a43b707795 Fix for PR# 1095, make's continuation line handling buggy
when used with .elif.  Additional fixes include:

    - fix continuation line handling when using .for
    - plug up a memory leak
1996-09-22 02:28:36 +00:00
steve
29accf9e0f Fix for PR# 1427, yacc-generated parser generates warnings
with -Wall.  Tim's work with some minor additions by me.

Submitted by:	Tim Vanderhoek <hoek@freenet.hamilton.on.ca>
1996-09-22 02:05:53 +00:00
pst
365fa6d6f8 Fix some compilation warnings 1996-09-22 01:05:21 +00:00
pst
8ddc5c2acb Fix some compilation warnings. 1996-09-21 18:01:23 +00:00
steve
c2d4b0268c Fix for PR#1230, make ``.for'' loops iterate backwards. 1996-09-21 04:00:22 +00:00
nate
717bed3db1 More ts_nse -> tv_nsec changes following the kernel changes I made earlier.
Submitted by:	Chuck Robey <chuckr@glue.umd.edu>
1996-09-20 02:34:51 +00:00
phk
df8df7f441 For now we just hexdump the stuff in USER records. 1996-09-19 19:50:45 +00:00
phk
fcdb3184db The userland change to the utrace(2) call. 1996-09-19 19:50:17 +00:00
peter
43f6021163 Attempt to untangle the timeout code a bit, also make the default ftp
and http timeouts the same, since when using a http proxy to do ftp
transfers, the http timeout was being used for what is coming in via
ftp.
1996-09-19 18:07:24 +00:00
peter
ae3b6a683b Make fetch 64-bit safe, corresponding to libftpio changes.
Submitted by: Jason Thorpe <thorpej@nas.nasa.gov>, PR#1641
1996-09-19 17:31:34 +00:00
phk
5f8eb47742 Make "ftp" a synonym for "open" 1996-09-19 08:16:47 +00:00
phk
75b39c00ce Make telnet a synonym for open 1996-09-19 08:15:56 +00:00
peter
89bb2f09ad Clean up dependencies a bit (we were not doing a depend on scan.c)
Make the 'bootstrap' target work a little better.
1996-09-19 05:21:07 +00:00
peter
4ef573301c Do not claim that tip is also called cu.
Submitted by: "Ph. Charnier" <charnier@xp11.frmug.org>, PR#1639
1996-09-19 05:14:30 +00:00
wollman
df37b0422c Clean up style and formatting. The listing of options could still be
improved.
1996-09-18 16:48:54 +00:00
swallace
61bc096e33 Restore previous compatibility of ${.CURDIR}/obj.uname -m and
$(.CURDIR}/obj search while retaining compatability of new
prefix with cwd for the current source tree builds.
.TARGETOBJDIR has been removed from make and CANONICALOBJDIR set in
bsd.obj.mk

The builtin object directory searching is defined specifically as:

If MAKEOBJDIRPREFIX is defined, the search order is
${MAKEOBJDIRPREFIX}${.CURDIR}
${.CURDIR}

Else if MAKEOBJDIR is defined, the search order is
${MAKEOBJDIR}
${.CURDIR}

Otherwise, default to the search order
${.CURDIR}/obj.`uname -m`
$(.CURDIR}/obj
/usr/obj${.CURDIR}
${.CURDIR}

Reviewed by:	bde
1996-09-18 06:06:39 +00:00
phk
132596c18d Add '-C' "Canonical" format to hexdump:
$ hexdump -C /etc/resolv.conf
00000000 64 6f 6d 61 69 6e 20 64 6b 2e 74 66 73 2e 63 6f |domain dk.tfs.co|
00000010 6d 0a 6e 61 6d 65 73 65 72 76 65 72 20 31 34 30 |m.nameserver 140|
00000020 2e 31 34 35 2e 32 33 30 2e 31 30 0a             |.145.230.10.|
1996-09-16 21:18:48 +00:00
wosch
0db310bc8e #include <fastfind.c> -> #include "fastfind.c" 1996-09-16 01:17:25 +00:00
wosch
d403258fea remove unnecessary boundary check, 2x faster
code cleanup
1996-09-14 20:15:49 +00:00