aboutsummaryrefslogtreecommitdiff
path: root/bin/ed/io.c
Commit message (Collapse)AuthorAgeFilesLines
* Drop ed(1) "crypto"Conrad Meyer2018-11-041-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=340132
* Close the input FILE * in read_file() and the output FILE * in write_file()Don Lewis2016-05-251-9/+18
| | | | | | | | | | | | | if read_stream() or write_stream() fails to avoid leaking the FILE. Reported by: Coverity CID: 977702 Reviewed by: pfg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6554 Notes: svn path=/head/; revision=300692
* More -Wmissing-variable-declarations fixes.Ed Schouten2012-10-191-9/+0
| | | | | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'. Notes: svn path=/head/; revision=241737
* Fix warnings found by -Wmising-variable-declarations.Ed Schouten2012-10-191-2/+2
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=241720
* Fix some obtuse fprintf tricks in bin/ed.Dimitry Andric2011-12-161-2/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=228595
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Consistently use __FBSDIDDavid E. O'Brien2002-06-301-4/+2
| | | | Notes: svn path=/head/; revision=99109
* o __P has been reovedWarner Losh2002-02-021-30/+9
| | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=90109
* o Correctly define rcsid.Mike Barcroft2001-08-061-20/+16
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=81220
* $Id$ -> $FreeBSD$Peter Wemm1999-08-271-1/+1
| | | | Notes: svn path=/head/; revision=50471
* sccsid -> rcsid and fix some minor nits.Steve Price1997-08-071-2/+5
| | | | Notes: svn path=/head/; revision=27963
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22988
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=21673
* -Wall cleaning.Steve Price1996-12-141-2/+2
| | | | Notes: svn path=/head/; revision=20420
* Output line count to stdout. Complies to POSIX.2.Thomas Gellekum1996-05-231-3/+3
| | | | | | | Reviewed by: joerg Notes: svn path=/head/; revision=15877
* You will find enclosed some changes to make gcc -Wall more happy inJoerg Wunsch1995-03-191-4/+4
| | | | | | | | | | | | /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) Notes: svn path=/head/; revision=7165
* Added $Id$David Greenman1994-09-241-0/+2
| | | | Notes: svn path=/head/; revision=3044
* use umask 077 for buffer fileAndrew Moore1994-03-231-1/+1
| | | | Notes: svn path=/head/; revision=1297
* Fixed range address bug: 1,2, == 2,2 not 2,.Andrew Moore1994-02-011-0/+375
Overhauled the name space, reworked some modules and removed the obsolescent Addison-Wesley copyright. Notes: svn path=/head/; revision=1057