Commit graph

19 commits

Author SHA1 Message Date
qwx e279699344 plumber: remove $plumbsrv, add optional srvname, usage check
Plumber both posts a service to /srv and sets a $plumbsrv environment
variable.  Our libplumb no longer uses $plumbsrv and nothing else
does.  It's a silly hack;  rc doesn't update /env immediately, and
scripts, which for instance set up subrios, cannot rely on it to
clean up the plumber at the end.

Instead, add the option to specify a srvname, actually check for some
common errors and print a usage string.

Thanks to Ori for input and a preliminary patch.
2021-09-10 21:03:47 +00:00
Humm b2ef0ff49d plumber: fix substrings in match rules
Unmatched substrings are nil, so we can't rely on nil terminating the
array of substrings.
2021-04-21 08:28:32 +02:00
cinap_lenrek fb08e3655e plumber: open rule files as OCEXEC, to avoid leaking them to sub commands 2020-12-29 18:45:42 +01:00
cinap_lenrek ceeb701a2b plumber: don't leak srvfd file descriptor into sub processes
Put OCEXEC flag on the srvfd so it wont be leaked
on sub-processes we spawn from plumb rules.
2020-12-28 21:00:15 +01:00
Sigrid 67672ffdc9 plumb: fix wrong click attribute offset (thanks umbraticus) 2020-12-28 12:24:47 +01:00
kvik e5894dccea pre-lib9p servers: fix incorrect Tversion handling
version(5) says:

	If the server does not understand the client's version
	string, it should respond with an Rversion message (not
	Rerror) with the version string the 7 characters
	``unknown''.

Pre-lib9p file servers -- all except cwfs(4) -- do return Rerror.

lib9p(2) follows the above spec, although ignoring the next part
concerning comparison after period-stripping.  It assumes an
Fcall.version starting with "9P" is correctly formed and returns
the only supported version of the protocol, which seems alright.

This patch brings pre-lib9p servers in accordance with the spec.
2020-08-01 15:27:28 +02:00
cinap_lenrek ac88ce4f7f make bind(2) error handling consistent
The mount() and bind() syscalls return -1 on error,
and the mountid sequence number on success.

The manpage states that the mountid sequence number
is a positive integer, but the kernels implementation
currently uses a unsigned 32-bit integer and does not
guarantee that the mountid will not become negative.

Most code just cares about the error, so test for
the -1 error value only.
2020-05-02 17:32:01 +02:00
Ori Bernstein d52d7bc121 Backed out changeset 2737b9af622b
not what I wanted to commit.
2020-04-25 10:57:17 -07:00
Ori Bernstein 2de164c51d fix typos in time calculation
the results of the time calculation were garbled -- and
apparently negative on my system when testing, so the
test passed when it shouldn't have.
2020-04-25 10:43:39 -07:00
BurnZeZ 12e136332a plumber: loop will go out of bounds when *++s == '\0'; replace with strstr 2019-05-31 22:15:53 +00:00
cinap_lenrek 4808971db6 plumber: fix memory and filedescriptor leaks (thanks BurnZeZ) 2018-10-11 22:49:45 +02:00
ftrvxmtrx 0930f44feb cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
cinap_lenrek a0d4c5e208 make error handling in 9p service loops consistent
when we get eof, stop the loop immidiately and do not
rely on the read to eventually return an error.

when convM2S() fails to decode the message, error out
and stop the loop. there is no point in continuing.
2016-07-24 02:21:32 +02:00
ftrvxmtrx a25758dce7 fix strncmp/memcmp used with a wrong number 2015-06-11 22:13:55 +02:00
cinap_lenrek e36d9f5c4e make filesystem handling of read9pmsg() consistent 2013-06-16 06:26:31 +02:00
cinap_lenrek 9e8b285562 plumber: use 16K stack, make libplumb thread safe 2012-03-09 09:11:12 +01:00
cinap_lenrek 83b56186e4 plumber: fix memory leaks 2012-01-29 03:48:24 +01:00
Taru Karttunen a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen e5888a1ffd Import sources from 2011-03-30 iso image 2011-03-30 15:46:40 +03:00