summaryrefslogtreecommitdiff
path: root/bin/ed
Commit message (Collapse)AuthorAgeFilesLines
* Drop ed(1) "crypto"Conrad Meyer2018-11-048-467/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* ed(1): Allow the omission of one address in (.,.) and (.;.) address rangesPedro F. Giffuni2017-07-031-2/+3
| | | | | | | | | | | | 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) Notes: svn path=/head/; revision=320603
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Remove bdes(1)Allan Jude2017-02-061-5/+1
| | | | | | | | | | | | | | | | | | The use of DES for anything is discouraged, especially with a static IV of 0 If you still need bdes(1) to decrypt Kirk's video lectures, see security/bdes in ports. This commit brought to you by the FOSDEM DevSummit and the "remove unneeded dependancies on openssl in base" working group Reviewed by: bapt, brnrd Relnotes: yes Sponsored by: FOSDEM DevSummit Differential Revision: https://reviews.freebsd.org/D9424 Notes: svn path=/head/; revision=313329
* Revert crap accidentally committedBaptiste Daroussin2017-01-281-1/+1
| | | | Notes: svn path=/head/; revision=312927
* Revert r312923 a better approach will be taken laterBaptiste Daroussin2017-01-281-1/+1
| | | | Notes: svn path=/head/; revision=312926
* ed(1): drop redundant parenthesis.Pedro F. Giffuni2016-12-141-2/+2
| | | | | | | These were Left-over from the cleanup in r309936. Notes: svn path=/head/; revision=310091
* ed(1): Simplify some checks.Pedro F. Giffuni2016-12-121-5/+5
| | | | | | | | | The return type for both fread(3) and fwrite(3) cannot be negative, this renders some checks invalid and variable 'ct' unnecessary. Also bump 'len' to size_t to avoid signed/unsigned comparison warnings. Notes: svn path=/head/; revision=309936
* ed(1): Prevent possible overflows during allocation.Pedro F. Giffuni2016-12-123-4/+4
| | | | | | | | | | 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 Notes: svn path=/head/; revision=309873
* Use .At macro instead of specifying AT&T UNIX literaly.Sevan Janiyan2016-10-021-2/+2
| | | | | | | | | | PR: 212034 Approved by: bcr (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8114 Notes: svn path=/head/; revision=306581
* 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
* ed(1): simplify by using arc4random_buf().Pedro F. Giffuni2016-05-211-4/+1
| | | | | | | Suggested by: ed Notes: svn path=/head/; revision=300340
* ed(1): Cleanups for the DES mode.Pedro F. Giffuni2016-05-201-2/+2
| | | | | | | | | | | | - Use arc4random_uniform(3). - Prevent a segmentation fault when ed receives a signal while being in getpass(). [1] Obtained from: OpenBSD [1] (CVS Rev. 1.15) MFC after: 2 weeks Notes: svn path=/head/; revision=300322
* ed(1): switch two statements so we check the index before dereferencing.Pedro F. Giffuni2016-04-261-1/+1
| | | | | | | | | This is related to r270256 but was missed in that occasion. MFC after: 3 days Notes: svn path=/head/; revision=298640
* Explicitly add unmarked bin/ binaries to the runtime package.Glen Barber2016-02-091-0/+1
| | | | | | | | | | | Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295439
* ed(1): Prevent possible string overflowsPedro F. Giffuni2015-12-181-4/+4
| | | | | | | | | | | Use strlcpy instead of strncpy to guarantee NULL termination. Pointed out by: imp CID: 1007252 X-MFC with: r292454 Notes: svn path=/head/; revision=292455
* ed(1): Prevent possible string overflowsPedro F. Giffuni2015-12-181-4/+6
| | | | | | | | CID: 1007252 MFC after: 2 weeks Notes: svn path=/head/; revision=292454
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-273-5/+4
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-1/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-191-3/+1
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ \ \ Merge from headSimon J. Gerraty2013-09-052-3/+3
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * \ \ \ \ sync from headSimon J. Gerraty2013-04-121-3/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | | | Sync from headSimon J. Gerraty2012-11-049-63/+51
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | | | mdoc: escape ReBaptiste Daroussin2015-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=281997
* | | | | | | | ed(1): Fix [-Werror=logical-not-parentheses]Eitan Adler2015-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /usr/src/bin/ed/glbl.c:64:36: error: logical not is only applied to theleft hand side of comparison [-Werror=logical-not-parentheses] Obtained from: Dragonfly (1fff89cbaeaa43af720a1f23d9c466b756dd8a58) MFC After: 1 month Notes: svn path=/head/; revision=281758
* | | | | | | | bin/ed: use correct type in multiplicationEitan Adler2015-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The result is line_t** so the multiplication should be size * sizeof(line_t*) MFC After: 1 month Notes: svn path=/head/; revision=281719
* | | | | | | | Convert bin/ to LIBADD, reduce overlinking allow to build all components asBaptiste Daroussin2014-11-251-2/+1
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | static Notes: svn path=/head/; revision=275028
* | | | | | | Always check the limits of array index variables before using them.Pedro F. Giffuni2014-08-211-1/+1
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtained from: DragonFlyBSD MFC after: 1 week Notes: svn path=/head/; revision=270256
* | | | | | When building picobsd, define WITHOUT_OPENSSL and WITHOUT_KERBEROS andWarner Losh2014-06-061-3/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove the now-redundant checks for RELEASE_CRUNCH. This originally was defined for building smaller sysinstall images, but was later also used by picobsd builds for a similar purpose. Now that we've moved away from sysinstall, picobsd is the only remaining consumer of this interface. Adding these two options reduces the RELEASE_CRUNCH special cases in the tree by half. Notes: svn path=/head/; revision=267147
* | | | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* | | | Fix a -Wunsequenced warning.Tim Kientzle2013-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: dt71@gmx.com Notes: svn path=/head/; revision=252374
* | | | mdoc sweep.Joel Dahl2013-05-121-2/+2
| |_|/ |/| | | | | | | | Notes: svn path=/head/; revision=250582
* | | Fix compiling ed w/ WITHOUT_ED_CRYPTO... These variables aren'tJohn-Mark Gurney2013-03-231-3/+1
| |/ |/| | | | | | | | | | | | | | | used.. Submitted by: deeptech71 at gmail dot com Notes: svn path=/head/; revision=248656
* | More -Wmissing-variable-declarations fixes.Ed Schouten2012-10-194-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-197-48/+45
|/ | | | | | | | | | | | | | 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
* Add build option MK_ED_CRYPTO to control whether ed(1) is to have theMarcel Moolenaar2012-05-191-3/+3
| | | | | | | | | | ability to encrypt/decrypt files. Embedded systems can typically have OpenSSL, but not for ed(1) to use it. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=235654
* Fix some obtuse fprintf tricks in bin/ed.Dimitry Andric2011-12-162-18/+20
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=228595
* Fix memory leaks in error cases.Christian Brueffer2011-08-271-0/+3
| | | | | | | | | | PR: 159011 Submitted by: Henning Petersen <henning.petersen@t-online.de> Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=225215
* Fix some typos under bin/Ulrich Spörlein2011-05-221-2/+2
| | | | | | | Found by: codespell Notes: svn path=/head/; revision=222178
* Fix typos.Rebecca Cran2011-02-121-2/+2
| | | | | | | | | PR: docs/131625 Submitted by: Andrew Wright <andrew at qemg.org> MFC after: 1 month Notes: svn path=/head/; revision=218619
* ed(1): make WARNS=6 cleanUlrich Spörlein2010-03-042-7/+1
| | | | | | | | | | | 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)) Notes: svn path=/head/; revision=204711