Commit graph

3852 commits

Author SHA1 Message Date
Ben Huntsman
6c4260fc67 bin/9c, bin/9l: Re-enable optimization on AIX. 2021-08-30 19:40:49 -04:00
Anthony Sorace
70cc6e5ba7 libthread: use setpgid instead of setpgrp 2021-04-22 08:44:27 -04:00
Russ Cox
93a25a0f97 install(1): mention libfontconfig1-dev for Debian
Also update install.txt, which mistakenly contained intro(1).

Pointed out by Nicholas Schwartz.
2021-04-09 15:23:55 -04:00
Günther Noack
878b30c0bc fspread: fix buffer overflow
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().
2021-04-05 05:19:49 -04:00
Russ Cox
88a87fadae all: update for new MIT license
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.
2021-03-23 20:59:23 -04:00
Russ Cox
a8bd9e9d8c mk: fix for Unix build 2021-03-23 20:54:29 -04:00
Russ Cox
73661401ea acme: fix double-free in acmeerrorproc
The receiver of cerr takes ownership of s.
2021-03-23 17:03:56 -04:00
Connor Taffe
90971376a5 mount: find kext with MacFUSE >=4 and macOS >=11 2021-01-31 20:52:49 -05:00
Connor Taffe
f62d4c4143 9pfuse: support MacFUSE >=4
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.
2021-01-31 20:52:49 -05:00
David Arroyo
a72478870a 9p: parse lines in rdwr command
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.
2021-01-31 11:52:08 -05:00
Fazlul Shahriar
36cd4c58c1 man9: rename IM to MR
Commit d32deab17b renamed IM to MR but
these man pages were missed.
2021-01-29 19:33:10 -05:00
Xiao-Yong Jin
0144f87dc6 htmlroff: fix array bounds 2021-01-29 06:32:41 -05:00
Xiao-Yong Jin
4e6bb208eb eqn: enlarge errbuf to account for large tokens 2021-01-29 06:32:41 -05:00
Xiao-Yong Jin
20c14efad6 xd: fix swizz8 loop counting 2021-01-29 06:32:41 -05:00
Xiao-Yong Jin
4056d6be4d libhtml: fix array bounds in lex 2021-01-29 06:32:41 -05:00
Russ Cox
52b599a63c libthread: call setpgrp in programs that will background
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.
2021-01-14 10:30:24 -05:00
Russ Cox
3ccd61629b sam: avoid out-of-bounds read in rterm
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.
2021-01-14 10:05:50 -05:00
Russ Cox
6a80119eb5 sam: remove backward ?:
The exit code here is ignored anyway.
2021-01-14 10:01:25 -05:00
Russ Cox
c3ae85a004 rc: do not exit on EINTR from read
This happens if lldb attaches to rc.
2021-01-14 09:59:54 -05:00
Russ Cox
0cc1faf015 lib9: reject postnote with special pids 2021-01-14 09:59:03 -05:00
Russ Cox
fdcf3d70c2 auxstats: do not postnote 0 2021-01-14 09:58:44 -05:00
Russ Cox
1c845e0bd5 acme, sam, samterm: remove weird switch usage
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.
2021-01-05 23:38:09 -05:00
Russ Cox
0a513e6560 sam: rm dregs 2021-01-05 23:37:04 -05:00
Russ Cox
7f6458b045 stats: add threadmaybackground 2021-01-05 23:37:04 -05:00
Russ Cox
ac487c754e acme: allow @ in file names
For upspin and other tools that put email addresses in names.
2020-12-30 14:44:01 -05:00
Jacob Vosmaer
6c8e44dd2e
wintext: add to moveplan9.files (#470) 2020-12-30 14:36:09 -05:00
Russ Cox
dbc153f51e 9term: add threadmaybackground 2020-12-30 10:40:25 -05:00
Russ Cox
f23783cbb1 .gitignore: add LOCAL.config and lib/fortunes.index 2020-12-30 08:46:54 -05:00
Russ Cox
ee9b2a2299 .gitignore: more binaries 2020-12-30 08:44:15 -05:00
Russ Cox
91ececc997 libthread: drop schedlock
Having two locks in the proc was causing deadlocks.
2020-12-30 08:41:01 -05:00
Russ Cox
4692dd4786 9c: drop PLAN9PORT_ASAN
It is no longer special.
2020-12-30 08:38:57 -05:00
Russ Cox
74577741c8 tcolors: add threadmaybackground 2020-12-30 08:12:04 -05:00
Russ Cox
0ed5e9f828 9a: remove a few mentions 2020-12-30 08:07:24 -05:00
Russ Cox
ebbeff0ac6 .gitignore: enumerate ignored parts of bin/ 2020-12-30 07:59:26 -05:00
Russ Cox
99dee78c2d all: remove $OBJTYPE from build
Now that we assume pthreads, the only assembly
left is in libmp and libsec.
We only ever added assembly for 386.
The portable C code is fine for plan9port.
2020-12-30 07:53:28 -05:00
Russ Cox
0bd1478342 wintext: use rc not bash 2020-12-30 07:53:28 -05:00
Nicola Girardi
0a7fe60681 9term: use openpty on NetBSD
Fixes #376.
2020-12-30 07:53:28 -05:00
Russ Cox
8b9aaf2e3f devdraw: add /usr/X11R7 for NetBSD
Fixes #362.
2020-12-30 07:53:28 -05:00
Russ Cox
1857120806 libthread: simplify
Now that everything uses pthreads and pthreadperthread,
can delete various conditionals, all the custom context code,
and so on. Also update documents.

Fixes #355.
2020-12-30 07:53:28 -05:00
Russ Cox
e68f07d46f libthread: make pthreadperthread the default 2020-12-30 00:20:26 -05:00
Russ Cox
b73633b1b4 libthread: fix pthreadperthread bugs 2020-12-30 00:15:37 -05:00
Russ Cox
b3a20a96eb libthread: add threadmaybackground
Programs that want to background themselves now need
to define threadmaybackground returning 1.
This avoids a confusing (to people and debuggers)
extra parent process for all the threaded programs
that will never want to background themselves.
2020-12-30 00:12:14 -05:00
Russ Cox
5b37d91264 libthread: delete NetBSD special case
I added a direct call from thread.c to pthread.c's _threadpthreadstart
in May, and no one has complained about NetBSD being broken.
So probably no one is using this on NetBSD at all.
Make pthread the only option.
2020-12-30 00:06:35 -05:00
Russ Cox
69439fae67 9c: use -fcommon for clang
Fixes #469.
2020-12-30 00:06:35 -05:00
Russ Cox
2991442aef libthread: fix use after free of first thread in each proc
This was causing sporadic but frequent crashes at startup
in 9pserve on the new M1 Macs, correctly diagnosing a
use-after-free.
2020-12-15 00:06:03 -05:00
Russ Cox
a012d17433 time: print 1s of milliseconds 2020-12-15 00:06:03 -05:00
Anthony Sorace
291f741178 9c, 9l: updates for macOS arm64. 2020-09-27 06:45:02 -04:00
Russ Cox
1f098efb73 all: a few more #define tricks for AIX
This should make the AIX build finally work.

Fixes #400.
2020-08-15 20:46:23 -04:00
Russ Cox
d32deab17b tmac: rename IM (italic manual) to MR (manual reference)
Suggested by G. Brandon Robinson.
2020-08-15 20:09:40 -04:00
Russ Cox
9843fc0d82 fontsrv: fix handling of colored glyphs (emoji)
Drawing as white on black to produce a mask only works if
the white on black is the inversion of black on white.
Emoji that force use of specific colors don't respect that.
Draw black on white and invert to mask separately.
2020-08-15 09:10:54 -04:00