]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
9 years agokernel: remove waserror() arround newpage() in mntcache
cinap_lenrek [Tue, 16 Jun 2015 04:05:12 +0000 (06:05 +0200)]
kernel: remove waserror() arround newpage() in mntcache

newpage() does not raise error().

9 years agokernel: add pagechaindone() to wakeup processes waiting for memory
cinap_lenrek [Mon, 15 Jun 2015 15:40:47 +0000 (17:40 +0200)]
kernel: add pagechaindone() to wakeup processes waiting for memory

we keep the details about palloc in page.c, providing pagechaindone()
for mmu code to be called after a series of pagechainhead() calls.

9 years agodontkill: only use noswap flag to mark processes as not to be terminated on oom
cinap_lenrek [Mon, 15 Jun 2015 15:13:19 +0000 (17:13 +0200)]
dontkill: only use noswap flag to mark processes as not to be terminated on oom

changing procmode has the nasty side effect that notes cannot
be posted to them, prventing sysfatal() and threadexitsall()
to cleanup properly.

recent kernels also check the noswap flag to void killing them
in out of memory condition, so this is really all we need now.

9 years agothere's plenty of room in /lib
aiju [Mon, 15 Jun 2015 14:27:27 +0000 (16:27 +0200)]
there's plenty of room in /lib

9 years agokernel: implement separate wait queues for page allocation
cinap_lenrek [Mon, 15 Jun 2015 14:05:00 +0000 (16:05 +0200)]
kernel: implement separate wait queues for page allocation

give kernel processes and local disk file servers (procs
having noswap flag set) a clear advantage for page allocation
under starved condition by giving them ther own wait queue so
they get readied as soon as pages become available.

9 years agohjfs: defer parent directory permission check for wstat
cinap_lenrek [Mon, 15 Jun 2015 06:28:10 +0000 (08:28 +0200)]
hjfs: defer parent directory permission check for wstat

check parent directory permission *after* we determined
that the new name does not exist in the parent, so that
when the new name is the same as old name then no write
permission is required in the parent directory.

9 years agohjfs: fix wstat
cinap_lenrek [Sun, 14 Jun 2015 23:57:54 +0000 (01:57 +0200)]
hjfs: fix wstat

- rename to same name is ok
- only truncate when file size is different
- check for uid/gid *change*, not if it is specified or not

9 years agonusb/serial: remove unused channel
cinap_lenrek [Sun, 14 Jun 2015 22:30:19 +0000 (00:30 +0200)]
nusb/serial: remove unused channel

9 years agozynq: remove unused PTE typedef
cinap_lenrek [Mon, 15 Jun 2015 20:32:15 +0000 (22:32 +0200)]
zynq: remove unused PTE typedef

all the mmu code uses ulong, so get rid of the typeded.

9 years agozynq: remove unused statistics fields from Mach structure
cinap_lenrek [Mon, 15 Jun 2015 20:13:55 +0000 (22:13 +0200)]
zynq: remove unused statistics fields from Mach structure

9 years agondb/dns: cleanup forwarding code (redistrib())
cinap_lenrek [Sun, 14 Jun 2015 19:31:44 +0000 (21:31 +0200)]
ndb/dns: cleanup forwarding code (redistrib())

instead of copying the whole packet, just save the
udp header and restore it aftwards. dont call redistrib()
when there are no forwards (this should be almost always
the case).

9 years agotheo: You are on your own.
stanley lieber [Sun, 14 Jun 2015 00:34:33 +0000 (20:34 -0400)]
theo: You are on your own.

9 years agoaux/vga: == is not strncmp
ftrvxmtrx [Sat, 13 Jun 2015 19:28:33 +0000 (21:28 +0200)]
aux/vga: == is not strncmp

9 years agohtmlroff: fix wrong newline in \name handling (| -> ||)
cinap_lenrek [Sat, 13 Jun 2015 18:58:56 +0000 (20:58 +0200)]
htmlroff: fix wrong newline in \name handling (| -> ||)

9 years agoqc, 9/ppc, 9/mtx: fix wrong if statements
ftrvxmtrx [Sat, 13 Jun 2015 18:21:26 +0000 (20:21 +0200)]
qc, 9/ppc, 9/mtx: fix wrong if statements

9 years agokernel: dont use smalloc() to allocate pte array in ibrk()
cinap_lenrek [Sat, 13 Jun 2015 15:50:26 +0000 (17:50 +0200)]
kernel: dont use smalloc() to allocate pte array in ibrk()

when we'r out of kernel memory, it is probably better to
let that alloc fail instead of hanging while holding the
segment qlock.

9 years agovblade, cifs, usbuhci: fix parenthesis
cinap_lenrek [Sat, 13 Jun 2015 13:03:56 +0000 (15:03 +0200)]
vblade, cifs, usbuhci: fix parenthesis

9 years agolock: reopen lockfile after changing mode to make lock effective
cinap_lenrek [Sat, 13 Jun 2015 13:01:02 +0000 (15:01 +0200)]
lock: reopen lockfile after changing mode to make lock effective

lock is acquired on open/create when file has DMEXCL set in mode,
so we need to reopen the file after setting the bit with wstat.

9 years agolib9p: fix lib9p wstat qid.type/mode checks (fixes lock(1) for ramfs/hjfs)
cinap_lenrek [Sat, 13 Jun 2015 10:43:15 +0000 (12:43 +0200)]
lib9p: fix lib9p wstat qid.type/mode checks (fixes lock(1) for ramfs/hjfs)

9 years agondb/dns: use same buffer size of udp packet in redistrib() as dnudpserver() (fixes...
cinap_lenrek [Sat, 13 Jun 2015 20:37:26 +0000 (22:37 +0200)]
ndb/dns: use same buffer size of udp packet in redistrib() as dnudpserver() (fixes assert)

9 years agogames/doom: remove Makefile
cinap_lenrek [Fri, 12 Jun 2015 15:50:43 +0000 (17:50 +0200)]
games/doom: remove Makefile

9 years agogames/doom: fix desyncing demo (thanks qwx)
cinap_lenrek [Fri, 12 Jun 2015 15:28:09 +0000 (17:28 +0200)]
games/doom: fix desyncing demo (thanks qwx)

the code used P_Random()-P_Random() in some places which has
undefined evaluation order resulting in the wrong pseudo random
numbers being returned causing demo playback to desync.

this change adds P_Random2() function which returns the right
delta-random number and uses it in place of P_Random()-P_Random()
expression.

9 years agokernel: fix accounttime() for HZ >= 1000
cinap_lenrek [Fri, 12 Jun 2015 12:28:31 +0000 (14:28 +0200)]
kernel: fix accounttime() for HZ >= 1000

"milli-CPU's" is too low resolution for the decaying load average
calculation when HZ >= 1000.

9 years agozynq: increase kernel memory for graphics
cinap_lenrek [Thu, 11 Jun 2015 19:26:26 +0000 (21:26 +0200)]
zynq: increase kernel memory for graphics

9 years agozynq: mouse acceleration
cinap_lenrek [Thu, 11 Jun 2015 14:44:05 +0000 (16:44 +0200)]
zynq: mouse acceleration

9 years agozynq: make screen and cursor kprocs exit properly
cinap_lenrek [Thu, 11 Jun 2015 14:14:11 +0000 (16:14 +0200)]
zynq: make screen and cursor kprocs exit properly

9 years agozynq: add support for hardware cursor
cinap_lenrek [Thu, 11 Jun 2015 14:04:24 +0000 (16:04 +0200)]
zynq: add support for hardware cursor

to enable hardware cursor, write "addr va" to /dev/mousectl where
va is the virtual address of the cursor position register.

9 years agomerge
ftrvxmtrx [Thu, 11 Jun 2015 20:14:24 +0000 (22:14 +0200)]
merge

9 years agofix strncmp/memcmp used with a wrong number
ftrvxmtrx [Thu, 11 Jun 2015 20:13:55 +0000 (22:13 +0200)]
fix strncmp/memcmp used with a wrong number

9 years agocifsd: smbrename is still ok when file is readonly (fixed git)
cinap_lenrek [Wed, 10 Jun 2015 15:18:31 +0000 (17:18 +0200)]
cifsd: smbrename is still ok when file is readonly (fixed git)

9 years agozynq: fix flushmemscreen()
cinap_lenrek [Tue, 9 Jun 2015 23:27:44 +0000 (01:27 +0200)]
zynq: fix flushmemscreen()

9 years agoremove drawlsetrefresh and convM2Tnoenc: undefined functions
ftrvxmtrx [Tue, 9 Jun 2015 16:25:09 +0000 (18:25 +0200)]
remove drawlsetrefresh and convM2Tnoenc: undefined functions

9 years agoaddpt(2): put badrect in .SH NAME so that it gets into the searchindex
ftrvxmtrx [Tue, 9 Jun 2015 10:32:38 +0000 (12:32 +0200)]
addpt(2): put badrect in .SH NAME so that it gets into the searchindex

9 years agoesetcursor(2), alarm(2): fix prototypes
ftrvxmtrx [Tue, 9 Jun 2015 10:29:57 +0000 (12:29 +0200)]
esetcursor(2), alarm(2): fix prototypes

9 years agoevent(2): fix estartfn prototype
ftrvxmtrx [Tue, 9 Jun 2015 09:54:22 +0000 (11:54 +0200)]
event(2): fix estartfn prototype

9 years agoauthsrv.h: remove nonexistent prototypes
ftrvxmtrx [Tue, 9 Jun 2015 09:46:37 +0000 (11:46 +0200)]
authsrv.h: remove nonexistent prototypes

9 years agolibdraw: sync allocimage/allocwindow prototypes with man pages
ftrvxmtrx [Tue, 9 Jun 2015 08:33:30 +0000 (10:33 +0200)]
libdraw: sync allocimage/allocwindow prototypes with man pages

9 years agoip: fix wrong radix for iphash() (thanks yoann padioleau)
cinap_lenrek [Tue, 9 Jun 2015 08:04:04 +0000 (10:04 +0200)]
ip: fix wrong radix for iphash() (thanks yoann padioleau)

yoann padioleaus report on 9fans:

> I think I’ve found a bug in the network stack.
> in 9/ip/ip.h there is
> struct Ipht
> {
>  Lock;
>  Iphash *tab[Nipht];
> };
>
> where Night is 521,
>
> but then in 9/ip/ipaux.c there is
>
> ulong
> iphash(uchar *sa, ushort sp, uchar *da, ushort dp)
> {
>  return ((sa[IPaddrlen-1]<<24) ^ (sp << 16) ^ (da[IPaddrlen-1]<<8) ^ dp ) % Nhash;
> }
>
> where Nhash is just 64,

9 years agozynq: add /dev/fbctl to attach framebuffer to devdraw
cinap_lenrek [Tue, 9 Jun 2015 07:17:55 +0000 (09:17 +0200)]
zynq: add /dev/fbctl to attach framebuffer to devdraw

9 years agodevsegment: fix parsecmd() memory leak
cinap_lenrek [Tue, 9 Jun 2015 01:33:37 +0000 (03:33 +0200)]
devsegment: fix parsecmd() memory leak

9 years agolibdraw: consistent use of nil for pointers, error handling
cinap_lenrek [Mon, 8 Jun 2015 23:42:59 +0000 (01:42 +0200)]
libdraw: consistent use of nil for pointers, error handling

9 years agounix is BUGGERED. remove it
ftrvxmtrx [Mon, 8 Jun 2015 22:15:59 +0000 (00:15 +0200)]
unix is BUGGERED. remove it

9 years agoauthsrv: remove unused opasstokey
ftrvxmtrx [Tue, 9 Jun 2015 21:53:07 +0000 (23:53 +0200)]
authsrv: remove unused opasstokey

9 years agoaddpt(2): document badrect function
ftrvxmtrx [Tue, 9 Jun 2015 21:34:36 +0000 (23:34 +0200)]
addpt(2): document badrect function

9 years agofreeimage(2), readcolmap(2), writecolmap(2): fix prototypes
ftrvxmtrx [Tue, 9 Jun 2015 21:23:00 +0000 (23:23 +0200)]
freeimage(2), readcolmap(2), writecolmap(2): fix prototypes

9 years agoexec(2): exec argument size only limited by user stack size
cinap_lenrek [Mon, 8 Jun 2015 19:08:57 +0000 (21:08 +0200)]
exec(2): exec argument size only limited by user stack size

9 years agoexec(2): fix prototypes
ftrvxmtrx [Mon, 8 Jun 2015 10:59:51 +0000 (12:59 +0200)]
exec(2): fix prototypes

9 years agomerge
cinap_lenrek [Mon, 8 Jun 2015 00:49:02 +0000 (02:49 +0200)]
merge

9 years agoaux/vga: disable nvidiascale() as it broke modeset on kenjis card
cinap_lenrek [Mon, 8 Jun 2015 00:43:49 +0000 (02:43 +0200)]
aux/vga: disable nvidiascale() as it broke modeset on kenjis card

this code needs revision, need a list of cards where this actually
works.

9 years ago/lib/face: add updated addresses for quanstro, bwc, steve.simon (thanks, erik)
stanley lieber [Sun, 7 Jun 2015 19:12:06 +0000 (15:12 -0400)]
/lib/face: add updated addresses for quanstro, bwc, steve.simon (thanks, erik)

9 years agodevfs: remove useless ~OTRUNC mask for openmode
cinap_lenrek [Sun, 7 Jun 2015 15:41:43 +0000 (17:41 +0200)]
devfs: remove useless ~OTRUNC mask for openmode

9 years agozynq: fix /dev/pl
cinap_lenrek [Sun, 7 Jun 2015 15:33:31 +0000 (17:33 +0200)]
zynq: fix /dev/pl

prevent double sleep():
callers to sleep() need to be serialized as there can only
be one process sleeping at a time. plrlock and plwlock do
this.

wait for dma to complete in plwrite():
we have to wait for the dma to complete before touching
plbuf again.

maintain COPEN flag in archopen()/archclose():
when open fails because it was in use, clear the COPEN
flag, so archclose() wont screw stuff up.

9 years agofortunes: Turning off comments.
stanley lieber [Sat, 6 Jun 2015 22:20:48 +0000 (18:20 -0400)]
fortunes: Turning off comments.

9 years agosysinfo: update -p for sysinfo.9front.org
stanley lieber [Sat, 6 Jun 2015 22:18:38 +0000 (18:18 -0400)]
sysinfo: update -p for sysinfo.9front.org

9 years agosysupdate: change source repo to https://code.9front.org/hg/plan9front
cinap_lenrek [Sat, 6 Jun 2015 22:11:47 +0000 (00:11 +0200)]
sysupdate: change source repo to https://code.9front.org/hg/plan9front

code.google.com is shutting down, the new repository is on code.9front.org.

9 years agolibsec/tlshand: implement client side ECDHE (many thanks to pr!)
cinap_lenrek [Sun, 7 Jun 2015 20:14:01 +0000 (22:14 +0200)]
libsec/tlshand: implement client side ECDHE (many thanks to pr!)

9 years agolibsec/ecc: fix memory leak (free() vs mpfree())
cinap_lenrek [Sun, 7 Jun 2015 20:12:46 +0000 (22:12 +0200)]
libsec/ecc: fix memory leak (free() vs mpfree())

9 years agoprep(8): edisk also adds a EFI system partition (esp) when not already exists.
cinap_lenrek [Sat, 6 Jun 2015 00:13:01 +0000 (02:13 +0200)]
prep(8): edisk also adds a EFI system partition (esp) when not already exists.

9 years agoinst: provide gpt/mbr choice when disk is blank, format esp
cinap_lenrek [Sat, 6 Jun 2015 00:00:51 +0000 (02:00 +0200)]
inst: provide gpt/mbr choice when disk is blank, format esp

9 years agodisk/edisk: create esp partition in addition to plan9 partition in auto mode
cinap_lenrek [Fri, 5 Jun 2015 19:57:08 +0000 (21:57 +0200)]
disk/edisk: create esp partition in addition to plan9 partition in auto mode

9 years ago9boot: look for plan9.ini in all filesystems accessible to efi to find plan9 partition
cinap_lenrek [Fri, 5 Jun 2015 03:09:22 +0000 (05:09 +0200)]
9boot: look for plan9.ini in all filesystems accessible to efi to find plan9 partition

try the handle buffer in reverse order looking for plan9.ini
to find plan9 partition (9fat). when that fails, we'll default
to the first handle which should be the esp.

9 years agoape: define long long limits
mischief [Fri, 5 Jun 2015 00:16:23 +0000 (17:16 -0700)]
ape: define long long limits

9 years agodossrv: maintain file creation date/time on disk, fsinfo sector can be 0 (disabled)
cinap_lenrek [Thu, 4 Jun 2015 02:34:08 +0000 (04:34 +0200)]
dossrv: maintain file creation date/time on disk, fsinfo sector can be 0 (disabled)

9 years agodisk/format: create Fatinfo sector for fat32
cinap_lenrek [Thu, 4 Jun 2015 01:58:03 +0000 (03:58 +0200)]
disk/format: create Fatinfo sector for fat32

9 years agodisk/edisk: fix blank mode
cinap_lenrek [Wed, 3 Jun 2015 21:19:13 +0000 (23:19 +0200)]
disk/edisk: fix blank mode

there where two problems with blank (-b flag):

we did not update the backup header when there was already a valid
backup header in place. we always want to initialize a new backup header
in blank mode!

we now also check the backup header matches the primary (or the other
way arround depending on which header could be read), reporting any
mismatches and restoring the backup from the data of the primary.

the protective mbr needs to start at sector 1 not 0 (apparently, this
matters for ovmf).

9 years agorc-httpd: cleanup cgi handler
cinap_lenrek [Tue, 2 Jun 2015 14:56:19 +0000 (16:56 +0200)]
rc-httpd: cleanup cgi handler

- avoid silly stats and checks for $cgi_dir, just use status
  from builtin cd.

- log proper http status code from the cgi script

9 years agoauthsrv: use plan9 key for http authentication
cinap_lenrek [Mon, 1 Jun 2015 23:15:43 +0000 (01:15 +0200)]
authsrv: use plan9 key for http authentication

in addition to /sys/lib/httppasswords, allow http authentication
to use the plan9 password, which can be changed by the user.

9 years agohgweb.cgi: +x
cinap_lenrek [Tue, 2 Jun 2015 21:44:39 +0000 (23:44 +0200)]
hgweb.cgi: +x

9 years agohgweb.cgi: take REPO_ROOT and REPO_NAME from env, so can be used out of the box
cinap_lenrek [Tue, 2 Jun 2015 21:41:16 +0000 (23:41 +0200)]
hgweb.cgi: take REPO_ROOT and REPO_NAME from env, so can be used out of the box

9 years agorc-httpd: various fixes
cinap_lenrek [Tue, 2 Jun 2015 21:15:02 +0000 (23:15 +0200)]
rc-httpd: various fixes

care has to be taken when splitting the host into SERVER_NAME and SERVER_PORT,
as ipv6 uses : in the host part. also do it consistently, the host can be set
thru the request uri and the host header.

set REMOTE_USER to empty string to prevent accidents.

we do not handle chunked transfer encoding, just assuming the client doesnt
do keep alive is wrong. we have to reject the post when the client tries
chunked post with 411 "Length required" error.

9 years agodevtls: ignore UnrecogniedName (112) alert message (for SNI)
cinap_lenrek [Sun, 31 May 2015 23:32:57 +0000 (01:32 +0200)]
devtls: ignore UnrecogniedName (112) alert message (for SNI)

9 years ago9fs: handle all the dos filesystems in one case, add esp handler
cinap_lenrek [Sun, 31 May 2015 17:48:44 +0000 (19:48 +0200)]
9fs: handle all the dos filesystems in one case, add esp handler

9 years agodisk/fdisk: learn about EFI system partition (type 0xEF), honor protective mbr (type...
cinap_lenrek [Sun, 31 May 2015 17:30:38 +0000 (19:30 +0200)]
disk/fdisk: learn about EFI system partition (type 0xEF), honor protective mbr (type 0xEE)

efi systems may use traditional dos partition table
with an esp (efi system partition). otherwise, honor
the protective mbr partition (0xEE) and exit when we
encounter it.

9 years agoinst/bootplan9: skip mbr installation and active partition switching when we have...
cinap_lenrek [Sun, 31 May 2015 14:41:46 +0000 (16:41 +0200)]
inst/bootplan9: skip mbr installation and active partition switching when we have no plan9 dos partition

on efi systems, there is no plan9 partition in the dos partition table
that could be marked active and the mbr should be left alone.

9 years agoprep(8): document disk/edisk
cinap_lenrek [Sun, 31 May 2015 12:15:49 +0000 (14:15 +0200)]
prep(8): document disk/edisk

9 years agointegrate disk/edisk with diskparts, bootfs and installer (gpt support)
cinap_lenrek [Sun, 31 May 2015 11:06:18 +0000 (13:06 +0200)]
integrate disk/edisk with diskparts, bootfs and installer (gpt support)

9 years agolibdisk: error handling, sanity checks
cinap_lenrek [Sun, 31 May 2015 10:58:13 +0000 (12:58 +0200)]
libdisk: error handling, sanity checks

- make sure disk file is an actual file and not a directory, log or empty file
- sanity check: file has to be at least one sector to be a disk
- simplify error handling using freedisk()

9 years agodisk/edisk: little improvements
cinap_lenrek [Sun, 31 May 2015 09:19:22 +0000 (11:19 +0200)]
disk/edisk: little improvements

- make UU() shorter by using long long constant to encode node field
- store Flag as a mask, not as a shift count
- put the attributes before the name in cmdsum() as it is fixed length

9 years agotest: use libc.h constants for access() mode (thanks qrstuv)
cinap_lenrek [Sun, 31 May 2015 07:37:59 +0000 (09:37 +0200)]
test: use libc.h constants for access() mode (thanks qrstuv)

9 years agoio.h: fis comment PciSID (alphapc, kw, mtx, teg2) (thanks qeed!)
cinap_lenrek [Sat, 30 May 2015 14:50:02 +0000 (16:50 +0200)]
io.h: fis comment PciSID (alphapc, kw, mtx, teg2) (thanks qeed!)

9 years agopc/io.h: fix comment for PciSID
cinap_lenrek [Sat, 30 May 2015 14:45:02 +0000 (16:45 +0200)]
pc/io.h: fix comment for PciSID

9 years agodisk/edisk: fix usage (was disk/gdisk)
cinap_lenrek [Sat, 30 May 2015 01:36:58 +0000 (03:36 +0200)]
disk/edisk: fix usage (was disk/gdisk)

9 years agodisk/edisk: gpt partition table editor (no manpage, work in progress)
cinap_lenrek [Sat, 30 May 2015 01:22:08 +0000 (03:22 +0200)]
disk/edisk: gpt partition table editor (no manpage, work in progress)

9 years agodisk/partfs: adding identical partition is no-op
cinap_lenrek [Sat, 30 May 2015 20:37:46 +0000 (22:37 +0200)]
disk/partfs: adding identical partition is no-op

9 years agodisk/fdisk: fix help text
cinap_lenrek [Sat, 30 May 2015 20:26:18 +0000 (22:26 +0200)]
disk/fdisk: fix help text

9 years agonusb/disk: adding identical partition is a no-op
cinap_lenrek [Sat, 30 May 2015 20:24:55 +0000 (22:24 +0200)]
nusb/disk: adding identical partition is a no-op

9 years agocputime(2): fix prototype for cycles() (thanks qrstuv)
cinap_lenrek [Thu, 28 May 2015 16:11:45 +0000 (18:11 +0200)]
cputime(2): fix prototype for cycles() (thanks qrstuv)

9 years agotcs: fix swaped alias mapping gb <-> gb2312
cinap_lenrek [Thu, 28 May 2015 14:39:04 +0000 (16:39 +0200)]
tcs: fix swaped alias mapping gb <-> gb2312

9 years agouhtml: check if document is valid utf8 even with charset specified
cinap_lenrek [Thu, 28 May 2015 14:37:55 +0000 (16:37 +0200)]
uhtml: check if document is valid utf8 even with charset specified

often, documents specify charsets but are really utf-8 encoded.
we now try to decode as utf-8 and only if that fails assume
the charset specified in the document.

9 years agolibsec: cleanup x509 and tlshand
cinap_lenrek [Wed, 27 May 2015 22:31:36 +0000 (00:31 +0200)]
libsec: cleanup x509 and tlshand

- add overflow checks for newbytes(), newbits(), newints()
- remove suspicious nil check from estrdup()
- remove useless nil checks before free

9 years agoape: include <sys/types.h> in <sys/wait.h> for pid_t (thanks jens staal)
cinap_lenrek [Wed, 27 May 2015 19:48:42 +0000 (21:48 +0200)]
ape: include <sys/types.h> in <sys/wait.h> for pid_t (thanks jens staal)

9 years agolibsec/x509: fix verify_signature(), digest_certinfo(), X509dump()
cinap_lenrek [Wed, 27 May 2015 17:52:06 +0000 (19:52 +0200)]
libsec/x509: fix verify_signature(), digest_certinfo(), X509dump()

make digest_certinfo() return the digest length, otherwise
return -1 as an error and handle it in the callers.

pass expected digest length to verify_signature() and
check digest length from certificate! make sure we wont
run off the buffer.

fix newlines in error prints of X509dump().

9 years agolibsec/x509: use SHA2-256 digest algorithm instead of MD5
cinap_lenrek [Wed, 27 May 2015 16:35:37 +0000 (18:35 +0200)]
libsec/x509: use SHA2-256 digest algorithm instead of MD5

this implements SHA2 (224, 256, 384, 512) signature algorithms and
uses sha256WithRSAEncryption for X509req() and X509gen() instead
of oid_md5WithRSAEncryption.

9 years agopci: map pci bars for devices with base class codes (ccrb) 0x00 and 0x0D-0x11 (thanks...
cinap_lenrek [Tue, 26 May 2015 22:23:13 +0000 (00:23 +0200)]
pci: map pci bars for devices with base class codes (ccrb) 0x00 and 0x0D-0x11 (thanks qeed)

there are a few more device base class codes defined 0x0D-0x11, and
qemu appears to use base class code 0x00 for some of its fake
devices.

9 years agocc: set unspecified elements to zero in local variable initializers
cinap_lenrek [Tue, 26 May 2015 17:25:06 +0000 (19:25 +0200)]
cc: set unspecified elements to zero in local variable initializers

the compiler used to skip zero initialization when initializer
list was given not covering unspecified elements. now we zero
all non explicitely initialized elements. for example:

typedef struct F F;
struct F
{
int a;
int b;
int c;
};

void
main(void)
{
char a[16] = { 1, 2, 3 }; /* a[3..15] initialized to zero */
F f = { .b = 1 }; /* f.a, f.c initialized to zero */
}

9 years agorootstub: do not create pkg directories
stanley lieber [Mon, 25 May 2015 19:04:30 +0000 (15:04 -0400)]
rootstub: do not create pkg directories

9 years agoremove pkg(1): we regret the error
stanley lieber [Mon, 25 May 2015 19:03:44 +0000 (15:03 -0400)]
remove pkg(1): we regret the error

9 years agothread(2): fix prototype for threadint() and threadkillgrp() (thanks qwx!)
cinap_lenrek [Mon, 25 May 2015 11:03:45 +0000 (13:03 +0200)]
thread(2): fix prototype for threadint() and threadkillgrp() (thanks qwx!)

9 years agocc: handle unaligned data in = {0} local initializer
cinap_lenrek [Sun, 24 May 2015 23:57:18 +0000 (01:57 +0200)]
cc: handle unaligned data in = {0} local initializer

the emited code that initializes local variables did not handle
unaligned data causing stack corruption, affecting code like:

void main(void)
{
char a[9] = {0};
}

this change will emit code that does byte stores for the unaligned
bytes and also handles small objects (<= 16 bytes) without branches.

9 years agocdproto: /sys/log/httpd should be a directory
mischief [Thu, 21 May 2015 01:25:53 +0000 (18:25 -0700)]
cdproto: /sys/log/httpd should be a directory