summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* plumber: allow underscores in variable names in plumbing rulesIgor Burago2022-09-071-10/+19
| | | | Fixes #561.
* plumber: set match variables past the first non-matching subexpressionIgor Burago2022-09-071-6/+6
| | | | Fixes #563.
* plumber: fail on buffer exhaustion or runaway quotes in string expansionIgor Burago2022-09-061-11/+25
|
* src/cmd: print all usage messages to stderrTom Schwindl2022-09-062-2/+2
| | | | | All utilities print their usage message to stderr, cmp(1) and getflags(8) should do the same.
* troff: support `\~` as an alias for `\ ` (#567)g-branden-robinson2022-08-121-0/+2
| | | | | | | | | | | | | | In groff, Heirloom Doctools troff, and neatroff, the `\~` escape sequence produces an adjustable (paddable) but unbreakable space. mandoc, which does not perform adjustment or render to typesetters, supports the escape sequence as a synonym for `\ `, the same as `\0`. This extension is of long pedigree: groff has supported it for at least 30 years, Heirloom for 17, mandoc for 13, and neatroff for 6. Do the same as mandoc to prevent mis-rendering of documents using this escape sequence. Heirloom Doctools troff, a descendant of Documenter's Workbench troff, would be a good place to look for a compatible implementation of the adjustable semantics for this sequence.
* Fixed a use after free in rio.Karsten Pedersen2022-07-271-1/+2
| | | | Screen was being queried from within a client after it had been free'd.
* upas: don't hardcode path for rc(1)Sören Tempel2022-07-272-1/+4
|
* sam: use get9root instead of duplicating the logicSören Tempel2022-07-271-3/+1
|
* lib9: pass $PLAN9_TARGET via CPP for get9root fallback valueSören Tempel2022-07-273-3/+5
| | | | | Allows this function to always return the proper path in situations where the $PLAN9 environment variable is not set, i.e. a rc login shell.
* factotum: plug a memory leak in apoplufia2022-07-261-0/+1
|
* fontsrv: always compute new height and ascent for the font fileXiao-Yong Jin2022-07-261-9/+14
|
* devdraw/x11: fix modifier key handling for some XkbOptionsXiao-Yong Jin2022-07-261-12/+31
| | | | | | | | | | | | | Certain XkbOptions in X11 would change keysyms for modifier keys between the key press and key release. For example, under the XkbOptions "grp:shifts_toggle", though shift keys remain Shift_L/R when pressed, they become ISO_Group_Next/Prev when released. This behavior makes devdraw unable to detect the release event correctly and as a result mouse button 1 click always interpreted as button 3 event after a shift key is used.
* Bail out if convW2M(...) indicates failure.Igor Böhm2022-07-261-1/+2
|
* libdraw: fix out-of-bounds access to local buffer in event.c:startrpc()Igor Böhm2022-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function `startrpc()` stack allocates a local buffer of size 100: ```c static Muxrpc* startrpc(int type) { uchar buf[100]; ^^^^^^^^ Wsysmsg w; w.type = type; convW2M(&w, buf, sizeof buf); return muxrpcstart(display->mux, buf); } ``` The function `convW2M()` is called passing `buf`. That function accesses `buf` out-of-bounds: ```c uint convW2M(Wsysmsg *m, uchar *p, uint n) { ... case Tcursor2: PUT(p+6, m->cursor.offset.x); PUT(p+10, m->cursor.offset.y); memmove(p+14, m->cursor.clr, sizeof m->cursor.clr); memmove(p+46, m->cursor.set, sizeof m->cursor.set); PUT(p+78, m->cursor2.offset.x); PUT(p+82, m->cursor2.offset.y); memmove(p+86, m->cursor2.clr, sizeof m->cursor2.clr); memmove(p+214, m->cursor2.set, sizeof m->cursor2.set); p[342] = m->arrowcursor; ^^^^^^ ``` To fix the issue the size of local variable `buf` is increased from 100 to 512 to avoid out-of-bounds array access.
* fossil: fix EOF detection when reading 9P messageFazlul Shahriar2022-07-261-3/+2
| | | | | | | | | When the 9P connection is closed, reads on the connection will keep returning 0. So, fossil ends up looping forever, trying to read a 9P message, consuming 100% CPU. The fix interprets 0 bytes read as EOF. Reproduce by killing the 9pserve process serving the fossil service, or by listening on tcp and using 9p(1).
* deroff: fix out-of-bounds access if runes above 0X80 are inside EQ clausesmmnmnnmnmm2022-07-261-1/+1
|
* trim button & modbutton imagesAndriy Symonovych2022-07-261-3/+1
|
* make sure border has correct heightAndriy Symonovych2022-07-261-1/+1
|
* src/cmd/fontsrv: pad subfile names to support correct file lengthKyle Nusbaum2022-07-261-4/+4
| | | | | | | | For fonts with subfiles that go beyond the xffff range, the font file size calculation is incorrect, since lines beyond that range have additional characters. This patch pads all of the ranges and subfont names with leading zeros in order to keep them all lines the same length and fixes the font file length calculation.
* acme: Don't move the mouse if button depressedBen Huntsman2022-07-261-1/+4
| | | | Fixes #19
* rc: remove dead code.Ori Bernstein2022-05-111-2/+0
| | | | kencc warns that this code is dead.
* src/cmd/acme: provide info on presense or absence of undo history (#528)Roger Peppe2021-10-192-2/+4
| | | | | | It's sometimes useful to know whether there's been editing activity in a window. This PR adds that information to the ctl file. Change-Id: I21a342ac636dd5c7701b3ed560e3526867329c2c
* cmd/auxstats: improve network device name matcher in LinuxNicola Girardi2021-10-181-1/+3
|
* cmd/auxstats: improve wireless interface name matcher in LinuxNic2021-10-171-1/+4
|
* mk: provide a mechanism to default to `rc`Dan Cross2021-10-051-0/+2
| | | | | | | | | | | For cross-compiling plan9 from Unix, provide a way to force `mk` to use `rc` instead of `sh` without setting `MKSHELL` in individual `mkfile`s. If the environment variable `FORCERCFORMK` is set, `mk` will default to using `rc`, not `sh`. Signed-off-by: Dan Cross <cross@gajendra.net>
* sam: fix spurious overwrite messageRuss Cox2021-09-301-1/+1
| | | | | | | | | | | Fixes: % sam -d -. w foo foo: (new file) #0 w foo ?warning: write might change good version of `foo'
* acme: fix extra print argsRuss Cox2021-09-281-2/+2
|
* lib9p: Fix compile errorAlexander Kapshuk2021-09-011-1/+0
| | | | | | | | | | | | | | | | | | | | | commit 385a6d5877258cee0cac6151e6359c9206006b01 removed src/lib9p/_post.c from the code base, but overlooked removing a reference to the _post.o object file from the src/lib9p/mkfile. This results in lib9p failing to compile: * Running on Darwin... * Compiler version: Apple clang version 12.0.5 (clang-1205.0.22.11) * Building mk... * Building everything (be patient)... >>> mk: don't know how to make '/Users/sasha/plan9port_fork/lib/lib9p.a(_post.o)' in /Users/sasha/plan9port_fork/src/lib9p mk: for i in ... : exit status=exit(1) Remove _post.o from the list of dependent object files from src/lib9p/mkfile to have lib9p compile. Fixes: 385a6d587725 ("lib9p: Remove postmountsrv (#505)")
* lib9p: Remove postmountsrv (#505)Ben Huntsman2021-08-303-113/+0
|
* 9term: Skip unnecessary ioctl call on AIX.Ben Huntsman2021-08-302-1/+2
|
* libdraw: Fix GUI programs on AIX (#398)Ben Huntsman2021-08-301-0/+4
|
* libthread: use setpgid instead of setpgrpAnthony Sorace2021-04-221-1/+1
|
* fspread: fix buffer overflowGünther Noack2021-04-051-4/+9
| | | | | | | | | | | | | | | Without this fix, fspread is trusting the server to return as much data as requested, or less. If a server responds with more data though, fspread writes beyond the bounds of the buffer to fill, which is passed in by the caller. It depends on the caller of fspread() where that buffer is, so there are various possible attack vectors. In the Plan9 kernel, I found this implemented in devmnt.c, where overly large responses are truncated to the size requested before copying, so I assume that this strategy works here too. This also affects fsread() and fsreadn(), which are based on fspread().
* all: update for new MIT licenseRuss Cox2021-03-236-78/+22
| | | | | | | | | | | | | | | | | | | | | | | | On March 23, 2021, Nokia transferred the copyrights in the Plan 9 software to the Plan 9 Foundation, which relicensed them under the MIT license. This commit updates the Plan 9 from User Space license to reflect the new base license. The vast majority of the contributions beyond the base Plan 9 set were by me, many of them explicitly under an MIT license. Those are all under the new MIT license now as well. The port of mk to Unix was taken from Inferno via Vita Nuova and had been made available under GPL, but Vita Nuova has relicensed Inferno under the MIT license as well, to match the new Plan 9 license. Michael Teichgraber contributed src/lib9/zoneinfo.c explicitly under the Lucent Public License but has agreed to change the contribution to the MIT license now used in the rest of the distribution. There remain a few exceptions, most notably fonts. See the root LICENSE file for full details. The only mention of the Lucent Public License in the whole tree now is in the LICENSE file, explaining the history.
* mk: fix for Unix buildRuss Cox2021-03-231-2/+2
|
* acme: fix double-free in acmeerrorprocRuss Cox2021-03-231-4/+2
| | | | The receiver of cerr takes ownership of s.
* 9pfuse: support MacFUSE >=4Connor Taffe2021-01-311-1/+30
| | | | | | MacFUSE 4 removes support for passing device fd to the mount command. Adds support for the receiving the fd over a socket instead, and updates command paths and filesystem name.
* 9p: parse lines in rdwr commandDavid Arroyo2021-01-311-5/+9
| | | | | | | | Use bio(3) to read at most one line of input per iteration, even if there is more than one line available in the input buffer. This makes it easier to interact with line-oriented ctl files like that of factotum(4) from shell scripts, without the need to control when and how much data is flushed to a pipe.
* htmlroff: fix array boundsXiao-Yong Jin2021-01-291-2/+2
|
* eqn: enlarge errbuf to account for large tokensXiao-Yong Jin2021-01-292-2/+2
|
* xd: fix swizz8 loop countingXiao-Yong Jin2021-01-291-1/+1
|
* libhtml: fix array bounds in lexXiao-Yong Jin2021-01-291-1/+1
|
* libthread: call setpgrp in programs that will backgroundRuss Cox2021-01-141-0/+7
| | | | | | | This fixes the 'run stats from rc; exit rc; stats dies' problem. It's unclear whether this is the right fix or whether rc should be starting all its interactive commands in their own process groups. But at least it does fix stats dying.
* sam: avoid out-of-bounds read in rtermRuss Cox2021-01-141-2/+2
| | | | | | | | | | | Usually r->nused < r->nalloc and the read is in bounds. But it could in theory be right on the line and reading past the end of the allocation. Make it safe but preserve as much of the old semantics as possible. This use of rterm appears to be only for optimization purposes so the result does not matter for correctness.
* sam: remove backward ?:Russ Cox2021-01-141-1/+1
| | | | The exit code here is ignored anyway.
* rc: do not exit on EINTR from readRuss Cox2021-01-141-1/+10
| | | | This happens if lldb attaches to rc.
* lib9: reject postnote with special pidsRuss Cox2021-01-141-0/+5
|
* auxstats: do not postnote 0Russ Cox2021-01-141-1/+2
|
* acme, sam, samterm: remove weird switch usageRuss Cox2021-01-054-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | For whatever reason all three of these programs contain switches like: switch(x) { case 1: if(cond) case 2: f(); } Like Duff's device, this is legal C but more obscure than it really needs to be. This commit assumes those are intended as written and simply writes them more clearly. I did consider that maybe they are mistakes, but in the case of sam/regexp.c, my rewrite in this commit matches the acme/regx.c that has been in plan9port since I added acme in 2003. (I didn't bother to dig up the old Plan 9 releases.) Assuming acme/regx.c has been correct for the past two decades, this commit should be correct too.
* sam: rm dregsRuss Cox2021-01-054-293/+0
|