aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/wall/wall.c
Commit message (Collapse)AuthorAgeFilesLines
* ttymsg: OverhaulDag-Erling Smørgrav2026-05-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * Instead of an error string, return the usual 0 or -1 and let the caller figure out what, if anything, to tell the user. * Avoid string manipulations by opening /dev first and using openat() with O_RESOLVE_BENEATH. * Add a boolean argument which, if false, causes ttymsg() to return without sending the message if the tty's group-writable bit is not set. This saves programs that respect this setting (like syslogd(8)) from having to check before calling ttymsg(). * Update all callers. The observable effect of this change is minimal except for slightly different error messages when ttymsg() fails. However, syslogd(8) will no longer print spurious error messages on the console after trying and failing to write a log message to an X11 session. PR: 295171 MFC after: 1 week Reviewed by: jfree, markj Differential Revision: https://reviews.freebsd.org/D57018
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-8/+0
| | | | | | | | | | | 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
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-271-3/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: two-line .c patternWarner Losh2023-08-161-3/+0
| | | | Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* Close the fp rather than the fd since we fdopen the fd so we don'tWarner Losh2017-12-281-1/+1
| | | | | | | | | leak the FILE *. CID: 978383 Notes: svn path=/head/; revision=327277
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | 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
* 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
* Check the return error of set[e][ug]id. While this can never fail in theEitan Adler2012-10-221-1/+2
| | | | | | | | | | | | | current version of FreeBSD, this isn't guarenteed by the API. Custom security modules, or future implementations of the setuid and setgid may fail. Submitted by: Erik Cederstrand Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=241848
* Add multibyte char support.Gleb Smirnoff2012-03-211-48/+34
| | | | | | | | PR: 165429 Submitted by: amdmi3 Notes: svn path=/head/; revision=233269
* Add missing static keywords to wall(1)Ed Schouten2011-11-061-4/+4
| | | | Notes: svn path=/head/; revision=227200
* If one's message is longer than the buffer size, then we reset 'cnt' at theDavid E. O'Brien2011-07-121-1/+2
| | | | | | | wrong point and the actual column # get out of sync across the buffer size. Notes: svn path=/head/; revision=223940
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-111-4/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Perform all trivial ports to utmpx for usr.bin/.Ed Schouten2010-01-131-2/+1
| | | | | | | | They were already converted to use libulog, so it's easy to convert them to utmpx. Notes: svn path=/head/; revision=202200
* Add missing `void' keyword.Ed Schouten2009-12-291-1/+1
| | | | Notes: svn path=/head/; revision=201224
* Let wall(1) use utmpx.Ed Schouten2009-12-051-18/+11
| | | | | | | | | | | Because our implementation guarantees the strings inside struct utmpx to be null terminated, we don't need to copy everything out, which makes the code nicer to read. Also set WARNS to 6 and add $FreeBSD$ to keep SVN silent. Notes: svn path=/head/; revision=200156
* Fix some bugs in wall(1):David Schultz2008-01-151-6/+13
| | | | | | | | | | | | | - Handle wrapping correctly when \r appears in the input, and don't remove the \r from the output. - For lines longer than 79 characters, don't drop every 80th character. - Style: Braces around compound while statement. PR: 114498 Submitted by: Niclas Zeising <niclas.zeising@gmail.com> (earlier version) Notes: svn path=/head/; revision=175346
* In wall and who, check that the utmp entry isn't stalled, as it is done in w.Olivier Houchard2006-02-211-0/+15
| | | | | | | | | | Apparently with the new pts code stalled entries are printed, when they are not with the BSD ptys. Submitted by: Michal Mertl <mime at traveller dot cz> Notes: svn path=/head/; revision=155875
* Remove "sleeper" nonsense.Tim J. Robbins2003-02-211-4/+1
| | | | Notes: svn path=/head/; revision=111209
* WARNS=2 fix, use __FBSDID().Mark Murray2001-12-111-9/+10
| | | | | | | Not added to Makefile as WARNS=2 will be made default. Notes: svn path=/head/; revision=87675
* - Move the prototype of ttymsg() into ttymsg.h. syslogd and talkdDima Dorfman2001-09-091-2/+4
| | | | | | | | | | | | | also use this, and they shouldn't have to have their own prototypes. - Silence warnings about constness and signedness in ttymsg(). This includes changing the return value to a `const char *', and changing the types of `left' and `wret' (both byte counts) to ssize_t. Reviewed by: bde Notes: svn path=/head/; revision=83242
* Make ``wall -g'' really DTRT.Ruslan Ermilov2001-09-051-8/+11
| | | | | | | Reviewed by: imp, markm Notes: svn path=/head/; revision=83082
* When opening the file to broadcast, do it with the user's gid, not theKris Kennaway2001-05-081-2/+8
| | | | | | | | | | | egid (tty). Obtained from: OpenBSD Submitted by: Maxime Henrion <mux@qualys.com> Reviewed by: imp Notes: svn path=/head/; revision=76367
* Add -g group to usage message.Warner Losh2001-03-021-2/+4
| | | | | | | | | | Don't treat pointer as a boolean, but instead test it against NULL. Add warning for groups that don't exist Submitted by: ru Notes: svn path=/head/; revision=73320
* o Add support for wall -g. This will send a message to all members ofWarner Losh2001-03-011-13/+53
| | | | | | | | | | a given group. o Minor code style cleanups while I'm here Reviewed by: bde, kris, markm, audit@ Notes: svn path=/head/; revision=73255
* Cleanup this code a bit by attempting to sync it up with NetBSD andKris Kennaway2000-11-261-14/+15
| | | | | | | | | with each other. Reviewed by: markm, dwmalone Notes: svn path=/head/; revision=69231
* Instead of printing '(null)' if there is no tty, print 'no tty'.Nick Hibma2000-10-021-1/+5
| | | | | | | | In the case where the program is executed by a daemon running in the background the terminal might not have a tty. The '(null)' is confusing. Notes: svn path=/head/; revision=66557
* Let wall report the local timezone as well on output.Jeroen Ruigrok van der Werven2000-07-271-2/+2
| | | | | | | | | PR: 17867 Submitted by: Joel Ray Holveck <joelh@gnu.org> Nagged by: nrahlstr Notes: svn path=/head/; revision=63909
* column counter (cnt) not reset to 0 on display of '\r' which could causeDaniel Baker1999-09-011-1/+4
| | | | | | | | | unnecessary forced linewraps on some terminals. Submitted by: David McNett <nugget@slacker.com> Notes: svn path=/head/; revision=50776
* Corrected apparent omission in program logic which was causing theDaniel Baker1999-09-011-1/+2
| | | | | | | | | | insertion of redundant crlf's. Eliminated the venetian-blind effect in walled text. Submitted by: David McNett <nugget@slacker.com> Notes: svn path=/head/; revision=50772
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* PR: bin/8680Matthew Dillon1998-12-131-6/+8
| | | | | | | | | Increase the size of a number of buffers and replace strcpy/strcat/sprintf with snprintf(). There was a minor and possibly not exploitable security hole related to one sprintf(). Notes: svn path=/head/; revision=41717
* Change manual declarations of some functions to proper includesAndrey A. Chernov1997-09-151-15/+30
| | | | | | | | | Rewrote allowed character test to be more efficient Fix screen position calculations: control and 8bit characters was not counted properly Notes: svn path=/head/; revision=29434
* Use err(3). Add usage().Philippe Charnier1997-08-251-31/+30
| | | | Notes: svn path=/head/; revision=28695
* Add locale-independent control checks for security reasonAndrey A. Chernov1997-05-141-2/+4
| | | | Notes: svn path=/head/; revision=25812
* Localize itAndrey A. Chernov1997-05-131-0/+3
| | | | Notes: svn path=/head/; revision=25777
* Fix 8bit chars handlingAndrey A. Chernov1997-04-081-2/+11
| | | | Notes: svn path=/head/; revision=24729
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-291-1/+1
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24360
* Fix some improperly wrapped lines in the code.Alexander Langer1996-08-111-4/+2
| | | | Notes: svn path=/head/; revision=17505
* The talkd security hole can ealso be exploited by wall (and thus rwall).Guido van Rooij1994-10-231-0/+5
| | | | | | | | write and talk are not affected. Now print out escape sequences in the same way as is done by write(1). Notes: svn path=/head/; revision=3809
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+201
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590