Commit graph

220 commits

Author SHA1 Message Date
Ori Bernstein
f860f25f05 Add stdbool.h to ape
in accordance with c99:7.16. Used by perl, trivial enough
that I feel ok with adding it before the port is fully done.
2020-05-17 08:18:49 -07:00
Ori Bernstein
73f38fc546 [ape] add missing conversion flags for scanf
We're missing type flags for:

	hh: char
	ll: vlong
	z:  size_t
	t:  ptrdiff_t
	j:  intmax_t

The lack of '%lld' was causing us to fail when parsing
timezone files. This brings us in line with the specifiers
in the C99 standard, section 7.19.6.2p11
2020-05-12 10:48:33 -07:00
Ori Bernstein
5749900573 bring stdint.h closer to spec
C99 requires that if intXX_t types are defined, int_fastxx_t and
int_leastxx_t types are defined as well. We define all three to
be identical (intXX_t == int_fastXX_t == int_leastXX_t).
2020-05-06 15:39:12 -07:00
Ori Bernstein
d935bb25d2 use #error when missing define
This makes it easier to figure out what's going wrong when
we forget to define _POSIX_SOURCE.
2020-05-01 13:29:08 -07:00
Ori Bernstein
8ebe958ddf add missing header change (thanks qwx) 2020-04-26 09:03:42 -07:00
BurnZeZ
11025d6f4a lib9p: fix re-use of root Qid when using createfile(); remove unused dirqidgen 2020-03-29 17:39:30 +00:00
Ori Bernstein
2f67e21393 turn ptrdiff_t into a 64 bit type
while technically a 32 bit ptrdiff_t is in spec on
systems with 64 bit ponters as long as we guarantee
that individual objects are small enough, this can
confuse legitimate code, so lets fix this.
2020-03-24 14:45:15 -07:00
Ori Bernstein
0e1fec841e add intmax_t/uintmax_t as required by c99 7.18.1.5 2020-03-24 14:41:31 -07:00
cinap_lenrek
e9e55a21f6 lib9p: implement automatic remove-on-close cleanup in postsharesrv(), remove postfd() and sharefd() functions
with the latest changes to shr(3), we can use ORCLOSE on
the control file to get the mount in the share automatically
removed when the server exits or something goes wrong during
postsharesrv().

do not expose postfd() and sharefd() functions. they where
undocumented and leak the control file descriptors.
2020-03-08 22:00:23 +01:00
cinap_lenrek
225c359bea lib9p: get rid of Srv.nopipe and Srv.leavefdsopen hacks
it is unclear how Srv.nopipe flag should work inside
postmountserv(). if a server wants to serve on stdio
descriptors, he can just call srv() after initializing
Srv.infd and Srv.outfd.

The Srv.leavefdsopen hack can be removed now that acme
win has been fixed.
2020-03-07 20:19:14 +01:00
cinap_lenrek
2f976d8b56 libsec: move AES XTS function prototypes to AES definition section in the header file 2020-03-01 16:02:56 +01:00
cinap_lenrek
64640083de libsec: remove hash pickle functions, document ripemd160, cleanup sechash(2) manpage 2020-03-01 15:07:44 +01:00
Ori Bernstein
98374d6eea remove C99_SPRINTF_EXTENSION define.
It's been 20 years since c99 came out. By now, if code
hasn't been fixed, it's not going to be. Requiring this
define just confuses porters.
2020-02-10 19:26:39 -08:00
Roberto E. Vargas Caballero
5e9d8a7b18 Add toascii() to ape 2019-09-09 16:00:06 +01:00
Roberto E. Vargas Caballero
e0720a48b0 Add mkstemp to stdlib.h
q
2019-09-09 15:58:39 +01:00
Ori Bernstein
ff9ce8210a Include integer limits from generic stdint.h in system-specific stdint.h 2019-09-06 18:01:52 -07:00
Ori Bernstein
c09546ccea Add missing UINTsz_MIN defines to ape stdint.h 2019-09-06 16:33:11 -07:00
David du Colombier
27824a6c0b sys/src/libventi: define VtEntryNoArchive constant 2019-09-06 11:55:35 -07:00
David du Colombier
cb091e7539 sys/src/libventi: implement vtsha1 and vtsha1check functions 2019-09-06 11:55:18 -07:00
David du Colombier
63ae9ed53a sys/src/libventi: implement vtreconn and vtredial functions 2019-09-06 11:54:44 -07:00
cinap_lenrek
85216d3d95 auth/rsa2asn1: implement private key export with -a flag (thanks kvik)
kvik writes:

I needed to convert the RSA private key that was laying around in
secstore into a format understood by UNIX® tools like SSH.

With asn12rsa(8) we can go from the ASN.1/DER to Plan 9 format, but not
back - so I wrote the libsec function asn1encodeRSApriv(2) and used it in
rsa2asn1(8) by adding the -a flag which causes the full private key to be
encoded and output.
2019-08-30 07:34:35 +02:00
cinap_lenrek
4b4d68487c stdio: fix putc(), plan9 version 2019-06-20 00:04:58 +02:00
cinap_lenrek
ef1bcc7338 ape: fix stdio putc() macro, avoiding "result of operation not used" warning
moving _IO_CHMASK masking on the right hand side fixes it.
2019-06-19 23:59:25 +02:00
Ori Bernstein
ceed9b8853 Sand edges down on GBIT64()/PBIT64() macros.
Now, you can safely use them in unbraced if statements, and
with char*s.
2019-05-06 17:26:38 -07:00
cinap_lenrek
4f0bfe0fb8 dtracy: avoid dmachlock() race
between being commited to a machno and having acquired the lock, the
scheduler could come in an schedule us on a different processor. the
solution is to have dtmachlock() take a special -1 argument to mean
"current mach" and return the actual mach number after the lock has
been acquired and interrupts being disabled.
2019-03-30 09:17:46 +01:00
cinap_lenrek
0af11f97b5 libip: replace v4parsecidr() with new parseipandmask()
we want to accept V4 subnets in CIDR notation consistently which
means we need to interpret the mask in context of the IP address.
so parseipmask() now has an additional v4 flag argument which
offsets the prefixlength by 96 so a /24 will be interpreted
as a /120.

parseipandmask() is the new function which handles this automatically
depending on the ip address type.

v4parsecidr() is now obsolete.
2019-02-11 23:26:57 +01:00
aiju
c7304ea03c dtracy: get rid of DTName struct, support more than three parts in a probe name, wildcard matching 2018-12-13 10:42:49 +00:00
aiju
40d6302b5f forgotten files 2018-12-11 09:20:34 +00:00
aiju
ca851bbb5e dtracy: call dtptrigger with a struct pointer rather than a list of arguments; put return value in arg9 2018-12-09 21:43:22 +00:00
aiju
58fa29447b dtracy: add support for aggregations 2018-12-08 15:07:53 +00:00
mischief
cb7375dcbc ape: declare gethostname 2018-12-02 03:30:22 -08:00
aiju
e15b1b8930 add dtracy.h 2018-11-10 20:01:19 +00:00
mischief
6df3f7bf38 libmp: declare mpfactorial 2018-11-04 11:37:02 -08:00
cinap_lenrek
19166f2cf3 libc: add procsetname() 2018-09-26 14:56:23 +02:00
cinap_lenrek
311e3b51c6 libc: return number of bytes produced for idn2utf() and utf2idn() 2018-09-26 14:32:17 +02:00
cinap_lenrek
dfec09c436 libc: add utf2idn() and idn2utf() functions to deal with internationalized domain names 2018-09-25 20:14:25 +02:00
cinap_lenrek
a4e444f430 libndb: make ndbipinfo() walk ipnet for all matching entries, concatenate and dedup result 2018-09-16 12:39:47 +02:00
spew
91d0343627 ape: an implemenation of getitimer setitimer 2018-07-01 18:48:12 -04:00
spew
55c122d59f ape: add strnlen 2018-06-21 11:56:37 -04:00
spew
3b376b43af ape: provide bogus chroot implementation 2018-06-20 22:19:37 -04:00
spew
583c6d269b ape: add some common fields for stat, grp and pwd 2018-06-17 17:38:00 -04:00
aiju
db71e19005 add libttf 2018-06-09 14:33:19 +00:00
cinap_lenrek
930efe67e8 ape: fix auth.h 2018-05-20 23:22:41 +02:00
cinap_lenrek
6e19d19285 separate MSCHAP(v2) and NTLM(v2) authentication
due to linux omiting the final Z(4) in the NTLMv2 reply, and
the need for the windom for LMv2 authentication, here is a new
AuthNTLM ticket request now with length and dom fields.
2018-05-20 22:49:24 +02:00
qwx
19d6a98038 ape: add signed fixed size integer typedefs to u.h 2018-05-13 07:13:00 +02:00
cinap_lenrek
8f91d94d19 merge 2018-05-01 23:40:00 +02:00
cinap_lenrek
190c40c9ff ip/ipconfig: populate /net/ndb from v6 router advertisements, configure multiple addresses in ndbconfig()
we now update /net/ndb with the following information gathered
from router advertisements (rfc6106 and plan9 specific options):

- recursive dns servers (option 25, ndb: dns=)
- dns search list (option 31, ndb: dnsdomain=)
- plan9 fileserver (option 250, ndb: fs=)
- plan9 authserver (option 251, ndb: auth=)

note the plan9 specific options can be disabled with the -G flag.

for ndbconfig (-N flag), we now collect all ip addresses in ndb
belonging to the devices mac address and configue them all. v6
addresses are getting added when a link local address exists
or the -6 flag has been specified to automatically configure one.

move the dhcp code in its own dhcp.c file and make symbols static
that are not used across modules.
2018-05-01 23:32:28 +02:00
aiju
29f03ba4e7 libsat, forp: fix va_list hack on amd64 2018-04-24 12:20:07 +01:00
mischief
034d0b08e9 ape: improve assert macro
in a statement such as:

if(expr)
	assert(a);
else
	assert(b);

the previous definition of assert would fail to compile, as the else
would be dangling.  with a ternary expression, this construct works
fine.
2018-04-02 21:44:21 -07:00
aiju
57edb0b2d4 sat.h: update to include satget 2018-03-28 20:36:04 +00:00