History log of /freebsd-current/bin/ed/main.c
Revision Date Author Comments
# a400e259 11-Jan-2024 Chia-Jung Chang <maluma110020036@gapp.nthu.edu.tw>

ed(1): Fix grammar in comment

Event: Advanced UNIX programming course (Fall'23) at NTHU
Pull Request: https://github.com/freebsd/freebsd-src/pull/1025


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# d83db3fb 04-Nov-2018 Conrad Meyer <cem@FreeBSD.org>

Drop ed(1) "crypto"

You should not be using DES. You should not have been using DES for the
past 30 years.

The ed DES-CBC scheme lacked several desirable properties of a sealed
document system, even ignoring DES itself. In particular, it did not
provide the "integrity" cryptographic property (detection of tampering), and
it treated ASCII passwords as 64-bit keys (instead of using a KDF like
scrypt or PBKDF2).

Some general approaches ed(1) users might consider to replace the removed
DES mode:

1. Full disk encryption with something like AES-XTS. This is easy to
conceptualize, design, and implement, and it provides confidentiality for
data at rest. Like CBC, it lacks tampering protection. Examples include
GELI, LUKS, FileVault2.

2. Encrypted overlay ("stackable") filesystems (EncFS, PEFS?, CryptoFS,
others).

3. Native encryption at the filesystem layer. Ext4/F2FS, ZFS, APFS, and
NTFS all have some flavor of this.

4. Storing your files unencrypted. It's not like DES was doing you much
good.

If you have DES-CBC scrambled files produced by ed(1) prior to this change,
you may decrypt them with:

openssl des-cbc -d -iv 0 -K <key in hex> -in <inputfile> -out <plaintext>

Reviewed by: allanjude, bapt, emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17829


# be9e8bfa 03-Jul-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

ed(1): Allow the omission of one address in (.,.) and (.;.) address ranges

With this patch, ",n" is an abbreviation for "1,n", ";n" abbreviates
".;n". The "n," and "n;" variants mean "n,n" and "n;n", respectively.
Also, piping to a shell command does not count as a save, so don't reset
the modified flag.

Obtained from: OpenBSD (CVS Rev. 1.58, 1.59)


# 27150ef8 11-Dec-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

ed(1): Prevent possible overflows during allocation.

Make sure the parameters used for malloc(3) can hold size_t sizes.
This should help ed(1) handle bigger data in the future.

MFC after: 2 weeks


# 6e8ef9cb 18-Dec-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

ed(1): Prevent possible string overflows

Use strlcpy instead of strncpy to guarantee NULL termination.

Pointed out by: imp
CID: 1007252
X-MFC with: r292454


# bebd99b2 18-Dec-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

ed(1): Prevent possible string overflows

CID: 1007252
MFC after: 2 weeks


# ae824d80 18-Oct-2012 Ed Schouten <ed@FreeBSD.org>

Fix warnings found by -Wmising-variable-declarations.

This self-written compiler warning, which is hopefully going to be
committed into LLVM sources soon, warns about potentially missing
`static' keywords, similar to -Wmissing-prototypes.

- bin/pax: Move external declaration of chdname and s_mask into extern.h.
- bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h.
- sbin/mount_fusefs: Remove char *progname; use getprogname().
- others: add `static' where possible.


# 4bfc2007 16-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

Fix some obtuse fprintf tricks in bin/ed.

MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 55fa734d 04-Mar-2010 Ulrich Spörlein <uqs@FreeBSD.org>

ed(1): make WARNS=6 clean

Although argc and argv are never read after the longjmp is complete,
gcc is not clever enough to see that and needlessly warns about it.
So add volatile to silence the compiler.

Approved by: ed (the co-mentor, not ed(1))


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# bfe1239a 17-Aug-2006 Warner Losh <imp@FreeBSD.org>

while(0); -> while (0) in multiline macro


# a89237ae 09-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Sync program's usage() with manpage's SYNOPSIS.


# 34af7a1a 16-Jan-2005 Philippe Charnier <charnier@FreeBSD.org>

no need to have break; after return;


# 09a80d48 01-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Quiet warnings about copyright[].


# 0d9f1a69 25-Aug-2002 Philippe Charnier <charnier@FreeBSD.org>

Replace various spellings with FALLTHROUGH which is lint()able


# 5eb43ac2 29-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Consistently use __FBSDID


# 0e6c085a 19-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

We have a place for extern declarations of global variables in ed.h, do not
use main() to do it locally.


# 7669d0fc 01-Feb-2002 Warner Losh <imp@FreeBSD.org>

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
o gc some #ifdef sun ... #endif code

Approved by: arch@, new style(9)


# a4616748 06-Aug-2001 Mike Barcroft <mike@FreeBSD.org>

o Correctly define rcsid.
o Add consts where appropriate.
o Rename some variables that were shadowing global declarations.
o Remove register storage-classes.
o Make errmsg a const, so we can just set error messages instead
of using sprintf/strcpy.
o Set WARNS=2

Reviewed by: bde, des


# d164fef6 28-Jun-2001 Dima Dorfman <dd@FreeBSD.org>

Back out previous commit: it doesn't help anything since write_file(),
which is also called from handle_hup(), uses stdio(3). Furthermore,
this means that calling exit(3) (via quit()) there is required to
flush the buffer write_file() was working on.

Submitted by: bde


# e0e97f0a 23-Jun-2001 Dima Dorfman <dd@FreeBSD.org>

Don't call exit(3) from a signal handler.

Obtained from: OpenBSD


# 9842e24c 29-May-2001 Warner Losh <imp@FreeBSD.org>

Use PATH_MAX rather than MAXPATHLEN. Also fix a possible off by one
error caused by the -1 being on the wrong side of the comparison.
This would not cause an overflow, as near as I can tell, because we
truncate later anyway. We'd just fail to get a diagnostic for 1024
and 1025 byte file names.


# 4195af47 26-Nov-2000 Kris Kennaway <kris@FreeBSD.org>

Constify


# 0d8188ce 16-Oct-2000 Brian Somers <brian@FreeBSD.org>

Include sys/types.h


# 2ef72bc1 30-Apr-2000 Josef Karthauser <joe@FreeBSD.org>

Fixes a potential buffer overflow with 'ed [MAXPATHLEN + 1 characters]'.

Submitted by: Mike Heffner <spock@techfour.net>
Submitted on: audit@freebsd.org


# 2a456239 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# d1ade4ad 07-Aug-1998 Doug Rabson <dfr@FreeBSD.org>

Silence some warnings when building on the alpha.


# ad0b1f1a 08-Oct-1997 Eivind Eklund <eivind@FreeBSD.org>

make signal handlers errno safe

Obtained from: OpenBSD (file rev 1.11) - Theo de Raadt <deraadt@openbsd.org>


# 5967604a 07-Aug-1997 Steve Price <steve@FreeBSD.org>

sccsid -> rcsid and fix some minor nits.


# 93ef08af 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# b97fa2ef 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 78b09ffe 13-Dec-1996 Steve Price <steve@FreeBSD.org>

-Wall cleaning.


# de727e7d 11-Aug-1996 Andrey A. Chernov <ache@FreeBSD.org>

Localize it
8bit cleanup


# 2162b2d2 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.

Reviewed by: phk


# 0fd510b7 19-Mar-1995 Joerg Wunsch <joerg@FreeBSD.org>

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)


# 89730b29 23-Sep-1994 David Greenman <dg@FreeBSD.org>

Added $Id$


# d165d4ac 22-Mar-1994 Andrew Moore <alm@FreeBSD.org>

use umask 077 for buffer file


# 95e6217e 31-Jan-1994 Andrew Moore <alm@FreeBSD.org>

Fixed range address bug: 1,2, == 2,2 not 2,.
Overhauled the name space, reworked some modules and removed the
obsolescent Addison-Wesley copyright.