]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
8 years agofix fuckup
glenda [Tue, 25 Aug 2015 09:35:10 +0000 (09:35 +0000)]
fix fuckup

8 years agoimport E script from bell labs
mischief [Tue, 25 Aug 2015 09:07:46 +0000 (02:07 -0700)]
import E script from bell labs

8 years agolibc: import more endianness fixes (thanks cherry9)
mischief [Tue, 25 Aug 2015 08:58:41 +0000 (01:58 -0700)]
libc: import more endianness fixes (thanks cherry9)

from https://bitbucket.org/cherry9/plan9-loongson/

8 years agolibsec: fix probably_prime() endless loop for n == 3
cinap_lenrek [Sun, 23 Aug 2015 21:49:31 +0000 (23:49 +0200)]
libsec: fix probably_prime() endless loop for n == 3

8 years agoremove convkeys2
cinap_lenrek [Fri, 21 Aug 2015 22:21:11 +0000 (00:21 +0200)]
remove convkeys2

8 years agoinit: remove dependency to <authsrv.h>
cinap_lenrek [Fri, 21 Aug 2015 21:40:31 +0000 (23:40 +0200)]
init: remove dependency to <authsrv.h>

8 years agotapefs: remove dependency to <authsrv.h>
cinap_lenrek [Fri, 21 Aug 2015 21:38:56 +0000 (23:38 +0200)]
tapefs: remove dependency to <authsrv.h>

8 years agoimport(4): -o, -O flags gone
cinap_lenrek [Fri, 21 Aug 2015 21:29:10 +0000 (23:29 +0200)]
import(4): -o, -O flags gone

8 years agoremove srvold9p
cinap_lenrek [Fri, 21 Aug 2015 21:23:35 +0000 (23:23 +0200)]
remove srvold9p

8 years agocpu, import: remove old9p support
cinap_lenrek [Fri, 21 Aug 2015 21:22:59 +0000 (23:22 +0200)]
cpu, import: remove old9p support

8 years agoremove old9p cpu service
cinap_lenrek [Fri, 21 Aug 2015 21:21:41 +0000 (23:21 +0200)]
remove old9p cpu service

8 years agocmd/auth: remove private /dev/random reading routines, use genrandom()
cinap_lenrek [Fri, 21 Aug 2015 20:46:26 +0000 (22:46 +0200)]
cmd/auth: remove private /dev/random reading routines, use genrandom()

8 years agoauth/changeuser: set the aes key in plan9 database, but not in securenet db
cinap_lenrek [Fri, 21 Aug 2015 18:36:19 +0000 (20:36 +0200)]
auth/changeuser: set the aes key in plan9 database, but not in securenet db

8 years agokeyfs: fix typo (thanks jpm)
cinap_lenrek [Fri, 21 Aug 2015 18:11:11 +0000 (20:11 +0200)]
keyfs: fix typo (thanks jpm)

8 years agokernel/boot: do not handle kfs boot
cinap_lenrek [Fri, 21 Aug 2015 17:53:43 +0000 (19:53 +0200)]
kernel/boot: do not handle kfs boot

8 years agoremove kfs and kfscmd
cinap_lenrek [Fri, 21 Aug 2015 17:52:57 +0000 (19:52 +0200)]
remove kfs and kfscmd

8 years agoremove kfs references from manual
cinap_lenrek [Fri, 21 Aug 2015 17:51:03 +0000 (19:51 +0200)]
remove kfs references from manual

8 years agofshalt: remove kfs support
cinap_lenrek [Fri, 21 Aug 2015 17:40:29 +0000 (19:40 +0200)]
fshalt: remove kfs support

8 years agomkfs(8): dont mention kfs
cinap_lenrek [Fri, 21 Aug 2015 17:35:56 +0000 (19:35 +0200)]
mkfs(8): dont mention kfs

8 years agodisk/mkfs: rmeove kfs support
cinap_lenrek [Fri, 21 Aug 2015 17:32:48 +0000 (19:32 +0200)]
disk/mkfs: rmeove kfs support

8 years agocwfs: remove 9p1 support
cinap_lenrek [Fri, 21 Aug 2015 16:43:25 +0000 (18:43 +0200)]
cwfs: remove 9p1 support

8 years agoauthsrv: randomize aes key in mkkey(), not used yet.
cinap_lenrek [Fri, 21 Aug 2015 01:32:05 +0000 (03:32 +0200)]
authsrv: randomize aes key in mkkey(), not used yet.

8 years agoauthsrv: more aes key stuff
cinap_lenrek [Fri, 21 Aug 2015 01:16:50 +0000 (03:16 +0200)]
authsrv: more aes key stuff

8 years agointroduce AES key into nvram and keyfs
cinap_lenrek [Fri, 21 Aug 2015 00:43:31 +0000 (02:43 +0200)]
introduce AES key into nvram and keyfs

8 years agokfs: adjust to new libauthsrv
cinap_lenrek [Thu, 20 Aug 2015 18:56:00 +0000 (20:56 +0200)]
kfs: adjust to new libauthsrv

8 years agocwfs: adjust for new libauthsrv changes
cinap_lenrek [Thu, 20 Aug 2015 18:44:17 +0000 (20:44 +0200)]
cwfs: adjust for new libauthsrv changes

8 years agolibauthsrv: add missing files (thanks mischief)
cinap_lenrek [Thu, 20 Aug 2015 13:47:49 +0000 (15:47 +0200)]
libauthsrv: add missing files (thanks mischief)

8 years agolibsec: add pbkdf2_hmac_sha1() (from wpapsk factotum module)
cinap_lenrek [Wed, 19 Aug 2015 22:45:08 +0000 (00:45 +0200)]
libsec: add pbkdf2_hmac_sha1() (from wpapsk factotum module)

8 years agomerge
cinap_lenrek [Wed, 19 Aug 2015 19:07:40 +0000 (21:07 +0200)]
merge

8 years agolibauthsrv: generalize ticket service, not hardcoding ticket format and DES encryption
cinap_lenrek [Wed, 19 Aug 2015 19:06:17 +0000 (21:06 +0200)]
libauthsrv: generalize ticket service, not hardcoding ticket format and DES encryption

this is in preparation for replacing DES ticket encryption with
something better. but first need to make the code stop making
assumptions.

the wire encoding of the Ticket might be variable length
with TICKETLEN just giving an upper bound. the details will be
handled by libauthsrv _asgetticket() and _asgetresp() funciotns.

the Authenticator and Passwordreq structures are encrypted
with the random ticket key. The encryption schmeme will depend
on the Ticket format used, so we pass the Ticket* structure
instead of the DES key.

introduce Authkey structure that will hold all the required
cryptographic keys instead of passing DES key.

8 years ago/lib/1oct1993: use words correctly (thanks, spew)
stanley lieber [Tue, 18 Aug 2015 18:21:58 +0000 (14:21 -0400)]
/lib/1oct1993: use words correctly (thanks, spew)

8 years agoaux/statusbar: use title as rio window title (thanks qrstuv)
mischief [Tue, 18 Aug 2015 08:24:22 +0000 (01:24 -0700)]
aux/statusbar: use title as rio window title (thanks qrstuv)

8 years agolibsec: TLS1.2 server support, make cipher list with most prefered first
cinap_lenrek [Mon, 17 Aug 2015 20:27:56 +0000 (22:27 +0200)]
libsec: TLS1.2 server support, make cipher list with most prefered first

8 years agolibsec: TLS1.2 client support
cinap_lenrek [Mon, 17 Aug 2015 19:16:58 +0000 (21:16 +0200)]
libsec: TLS1.2 client support

8 years agobullshit: app, deep-learning, responsive.
cinap_lenrek [Mon, 17 Aug 2015 11:11:31 +0000 (13:11 +0200)]
bullshit: app, deep-learning, responsive.

8 years agocc: improve (non-) side effect detection (thanks charle)
cinap_lenrek [Mon, 17 Aug 2015 00:07:27 +0000 (02:07 +0200)]
cc: improve (non-) side effect detection (thanks charle)

8 years agogames/doom: fix array offsets for respawn angle (thanks qu7uux)
cinap_lenrek [Sun, 16 Aug 2015 20:12:11 +0000 (22:12 +0200)]
games/doom: fix array offsets for respawn angle (thanks qu7uux)

mthing->angle is a signed short, and if ANG45 * mthing->angle/45 < 0, the
result of the right shift is sign extended.
afaik, an being 16bit in the dos version of doom, you'd endup with a
negative array offset, which would just access values from adjacent arrays
(finetangent[] for finecosine[], and finecosine[] for finesine[]), and it
would result in a misplaced teleport fog in some circumstances (fog is not
in front of the player on respawn, hence "silent teleport"). so, this fix is
bug incompatible, but this only affects live multiplay.
to test:
% hget http://doomedsda.us/dm/ahfx7_2.zip | unzip -sv
extracting AHFX7_2.TXT
extracting AHFX7_2.LMP
% mv AHFX7_2.LMP ahfx7_2.lmp
% games/doom -playdemo ahfx7_2
[...]
doom 10553: suicide: sys: trap: fault read addr=0x400429e10 pc=0x205b45

8 years agogames/doom: fix gamma correction and key translation (thanks qu7uux)
cinap_lenrek [Sun, 16 Aug 2015 20:09:46 +0000 (22:09 +0200)]
games/doom: fix gamma correction and key translation (thanks qu7uux)

KEY_F11 and KEY_F12 are not KEY_F1+11 and KEY_F1+12 as it is assumed in
runetokey(), which prevents these keystrokes from being used. rather than
change runetokey(), it seems better to just change the key definitions in
doomdef.h (the new values don't correspond to any other keys anyway).

F11 is the gamma correction key. to make gamma correction actually work,
i_video.c:I_SetPalette must also take into account usegamma (this was just
never ported). cf i_video.c:UploadNewPalette in source code release.

F12 is the spycam key. the spycam switches the renderview to a different player
during a coop game, or when watching a multiplayer demo. this feature only
changes the renderview; sounds, palette effects, status bar, etc. are still
from the first player's perspective.

8 years agogames/doom: fix idclev cheat in doom2 and final doom (thanks qu7uux)
cinap_lenrek [Sun, 16 Aug 2015 20:08:11 +0000 (22:08 +0200)]
games/doom: fix idclev cheat in doom2 and final doom (thanks qu7uux)

a typo in st_stuff.c:ST_Responder prevents idclev (change level) cheat to work
in doom2 and final doom (gamemode == commercial): episode is set to 0, when
that's invalid, and ST_Responder just returns.
to test, while ingame type idclev, followed by:
. doom1: episode (1-3 or 1-4) then map number (1-9)
. doom2/final doom: map number (1-32)
incidentally, if the last digit typed is 1, the player's weapon will switch to
the fist, because of a different bug (basically kbdproc registering two events
when pressing a key, for 'c' and 'k' case).

8 years agogames/doom: fix unterminated comment causing sound bugs (from qu7uux)
cinap_lenrek [Sun, 16 Aug 2015 20:07:12 +0000 (22:07 +0200)]
games/doom: fix unterminated comment causing sound bugs (from qu7uux)

this bug was introduced in the plan9 port, and since i_sound.c compiles with
no warning, it was never noticed. in effect, the statement between the
unterminated comment and the next is ignored. channelids[] is used in addsfx()
to avoid re-adding certain sounds if they are already playing. one of those is
sfx_sawful, and because of this bug, it is added again each tic during which
the player fires the chainsaw, rather than reset every tic.
compare firing the chainsaw continuously with and without the patch (without
hitting an enemy).

8 years agodevether: duplicate flags when copying blocks (thanks erik quanstro)
cinap_lenrek [Sun, 16 Aug 2015 18:08:36 +0000 (20:08 +0200)]
devether: duplicate flags when copying blocks (thanks erik quanstro)

8 years agovc: word align automatics
cinap_lenrek [Sun, 16 Aug 2015 17:29:16 +0000 (19:29 +0200)]
vc: word align automatics

theres code that assumes one can dereference a char[] buffer on the stack
as a long (ghostscript gxblend.c), so make sure all automatics on the stack
are word aligned. this is not strictrly neccesary, but avoids some
trouble with unportable code.

8 years agogs: fix alignment bug in image_render_interpolate()
cinap_lenrek [Sun, 16 Aug 2015 16:20:22 +0000 (18:20 +0200)]
gs: fix alignment bug in image_render_interpolate()

8 years ago6l: fix vlong byte order when running on big endian machine (thanks erik quanstro)
cinap_lenrek [Sun, 16 Aug 2015 11:41:14 +0000 (13:41 +0200)]
6l: fix vlong byte order when running on big endian machine (thanks erik quanstro)

8 years agolibcontrol: fix label memory leak
mischief [Sun, 16 Aug 2015 07:04:27 +0000 (00:04 -0700)]
libcontrol: fix label memory leak

8 years agomothra: fix crash
cinap_lenrek [Sun, 16 Aug 2015 01:19:05 +0000 (03:19 +0200)]
mothra: fix crash

8 years agorio(4): document "delete" wctl message (thanks mischief)
cinap_lenrek [Sun, 16 Aug 2015 00:54:23 +0000 (02:54 +0200)]
rio(4): document "delete" wctl message (thanks mischief)

8 years agolibsec: fix mistake breaking tlsServer() (thanks sl)
cinap_lenrek [Sun, 16 Aug 2015 00:38:44 +0000 (02:38 +0200)]
libsec: fix mistake breaking tlsServer() (thanks sl)

8 years agocpu: cleanup ssl code, make sure -p works for any auth method
cinap_lenrek [Sat, 15 Aug 2015 23:47:10 +0000 (01:47 +0200)]
cpu: cleanup ssl code, make sure -p works for any auth method

8 years agoimport(4): clarify -E and -e options
cinap_lenrek [Sat, 15 Aug 2015 19:36:18 +0000 (21:36 +0200)]
import(4): clarify -E and -e options

8 years agolibsec: TLS1.1 support (needs new devtls)
cinap_lenrek [Sat, 15 Aug 2015 15:51:55 +0000 (17:51 +0200)]
libsec: TLS1.1 support (needs new devtls)

8 years agodevtls: TLS1.1 explicit iv support
cinap_lenrek [Sat, 15 Aug 2015 15:50:44 +0000 (17:50 +0200)]
devtls: TLS1.1 explicit iv support

using nrand() to fill the explicit iv, which isnt great but better
than no iv.

8 years agokernel: try freebroken() *before* killbig() (thanks aiju)
cinap_lenrek [Fri, 14 Aug 2015 12:45:19 +0000 (14:45 +0200)]
kernel: try freebroken() *before* killbig() (thanks aiju)

8 years agohjfs: fix deadlocks
cinap_lenrek [Thu, 13 Aug 2015 08:41:12 +0000 (10:41 +0200)]
hjfs: fix deadlocks

buffers which still have requests queued on them are not free!

we cannot chanedev() a buffer while it has still requests queued on it
and we canot just queue our request (having different address) on the
buffer while there are other requests before it, otherwise we would
create artificial block dependency that can cause deadlock.

8 years agohjfs: fix abort() in givebuf()
cinap_lenrek [Tue, 11 Aug 2015 15:56:06 +0000 (17:56 +0200)]
hjfs: fix abort() in givebuf()

it is possible for another getbuf() on buffer b to come in
before undelayreq() calls givebuf() on a buffer again. then
givebuf() would find b already busy and abort().

instead, we now handle what getbuf() did in givebuf() and
consider the Buf* argument to givebuf() as a hint only for
the case when we have to actually flush/read a block from
disk.

8 years agolibc: fix wunlock() libthread deadlock
cinap_lenrek [Mon, 10 Aug 2015 21:13:41 +0000 (23:13 +0200)]
libc: fix wunlock() libthread deadlock

when wunlock() was used by threads running within the same proc,
the wunlock() can deadlock as it keeps holding the RWLock.lock
spinlock while indirectly calling _threadrendezvous(). when
_threadrendezvous() switches to another thread in the same proc,
then that thread can hang at rlock()/wlock()/runlock() again
waiting for wunlock() to release the spinlock which will never
happen as lock() does not schedule threads.

wunlock() is changed to release the spinlock during rendezvous
wakeup of readers. note that this is a bit dangerous as more
readers might queue concurrently now which means that if
we cannot keep up with the wakeups, we might keep on waking
readers forever. that will be another patch for the future.

8 years agolibc: fix spim endianness
mischief [Sun, 9 Aug 2015 10:44:03 +0000 (03:44 -0700)]
libc: fix spim endianness

8 years agomount, srv: add -N flag to skip authentication and attach anonymously as "none"
cinap_lenrek [Mon, 10 Aug 2015 08:11:45 +0000 (10:11 +0200)]
mount, srv: add -N flag to skip authentication and attach anonymously as "none"

8 years agofortunes: If you want to do the work, I will review the results.
stanley lieber [Sun, 9 Aug 2015 04:36:10 +0000 (00:36 -0400)]
fortunes: If you want to do the work, I will review the results.

8 years agolib9p: make reqqueueflush() use new threadint(), which will also cover channel operations
cinap_lenrek [Mon, 10 Aug 2015 01:52:40 +0000 (03:52 +0200)]
lib9p: make reqqueueflush() use new threadint(), which will also cover channel operations

using "interrupt" ctl message directly doesnt work when the
process is doing libthread channel operations (threadrendezvous)
as it will just repeat a interrupted rendezvous(). threadint()
handles this for us.

8 years agolibthread: use "interrupt" proc ctl message instead of posting a note for threadint()
cinap_lenrek [Mon, 10 Aug 2015 01:48:37 +0000 (03:48 +0200)]
libthread: use "interrupt" proc ctl message instead of posting a note for threadint()

threadint() is called to interrupt channel operation or a system call.
the kernel provides a new "interrupt" procctl message to interrupt a
process commited to or being in a blocking syscall, which is similar,
but not the same. the main difference is that "interrupt" condition
is not cleared before the process actually attempts to block. also
can be cleared with "nointerrupt" ctl message. see proc(3)

8 years agolibthread: fix mistake, make "all" the default target again
cinap_lenrek [Mon, 10 Aug 2015 01:20:08 +0000 (03:20 +0200)]
libthread: fix mistake, make "all" the default target again

8 years agoacid -k: fix intrcount() for amd64
cinap_lenrek [Sun, 9 Aug 2015 20:43:53 +0000 (22:43 +0200)]
acid -k: fix intrcount() for amd64

8 years agoacid -k: fix procenv() to new data structure
cinap_lenrek [Sun, 9 Aug 2015 20:24:50 +0000 (22:24 +0200)]
acid -k: fix procenv() to new data structure

8 years agozunq: remove unused variables from devqspi
cinap_lenrek [Sun, 9 Aug 2015 20:05:14 +0000 (22:05 +0200)]
zunq: remove unused variables from devqspi

8 years agokernel: move "setargs" field in Proc structure after "nargs" and "args"
cinap_lenrek [Sun, 9 Aug 2015 19:48:58 +0000 (21:48 +0200)]
kernel: move "setargs" field in Proc structure after "nargs" and "args"

8 years agokernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag...
cinap_lenrek [Sun, 9 Aug 2015 19:35:50 +0000 (21:35 +0200)]
kernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag field in what would be wasted as padding

8 years agokernel: pgrpcpy(), simplify Mount structure
cinap_lenrek [Sun, 9 Aug 2015 19:16:10 +0000 (21:16 +0200)]
kernel: pgrpcpy(), simplify Mount structure

instead of ordering the source mount list, order the new destination
list which has the advantage that we do not need to wlock the source
namespace, so copying can be done in parallel and we do not need the
copy forward pointer in the Mount structure.

the Mhead back pointer in the Mount strcture was unused, removed.

8 years agokernel: fix Mheadache
cinap_lenrek [Sun, 9 Aug 2015 16:19:47 +0000 (18:19 +0200)]
kernel: fix Mheadache

there was a race between cunmount() and walk() on Mhead.from as Mhead.from was
unconditionally freed when we cunmount(), but findmount might have already
returned the Mhead in walk(). we have to ensure that Mhead.from is not freed
before the Mhead itself (now done in putmhead() once the reference count of the
Mhead drops to zero).

the Mhead struct contained two unused locks, removing.

no need to hold Pgrp.ns lock in closegrp() as nobody can get to it (refcount
droped to zero).

avoid cclose() and freemount() while holding Mhead.lock or Pgrp.ns locks as
it might block on a hung up fileserver.

remove the debug prints...

cleanup: use nil for pointers, remove redundant nil checks before putmhead().

8 years agorootstub: add spim
cinap_lenrek [Sat, 8 Aug 2015 07:20:48 +0000 (09:20 +0200)]
rootstub: add spim

8 years agocdproto: add spim
cinap_lenrek [Sat, 8 Aug 2015 06:56:08 +0000 (08:56 +0200)]
cdproto: add spim

8 years agoadd /spim
cinap_lenrek [Sat, 8 Aug 2015 06:38:25 +0000 (08:38 +0200)]
add /spim

8 years agopython: fix build for objtype=$spim
cinap_lenrek [Sat, 8 Aug 2015 06:34:16 +0000 (08:34 +0200)]
python: fix build for objtype=$spim

8 years agogs: fix build for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:31:49 +0000 (08:31 +0200)]
gs: fix build for objtype=spim

8 years agolibmp: fix build for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:25:36 +0000 (08:25 +0200)]
libmp: fix build for objtype=spim

8 years agoape: fix build for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:17:54 +0000 (08:17 +0200)]
ape: fix build for objtype=spim

8 years agofix library mkfiles for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:04:41 +0000 (08:04 +0200)]
fix library mkfiles for objtype=spim

8 years agolibmach: remove redundant check for big endian
mischief [Wed, 5 Aug 2015 13:37:02 +0000 (06:37 -0700)]
libmach: remove redundant check for big endian

8 years agolibmach: remove useless error check from previous commit
mischief [Wed, 5 Aug 2015 13:30:57 +0000 (06:30 -0700)]
libmach: remove useless error check from previous commit

8 years agolibmach: set correct endianness with little endian ELF32 mips binaries
mischief [Wed, 5 Aug 2015 13:26:23 +0000 (06:26 -0700)]
libmach: set correct endianness with little endian ELF32 mips binaries

8 years agokernel: remove unused MAXCRYPT constant from portdat.h
cinap_lenrek [Thu, 6 Aug 2015 11:35:03 +0000 (13:35 +0200)]
kernel: remove unused MAXCRYPT constant from portdat.h

8 years agovgaigfx: remove #define MB, theres a MB enum in portdat.h
cinap_lenrek [Thu, 6 Aug 2015 11:33:39 +0000 (13:33 +0200)]
vgaigfx: remove #define MB, theres a MB enum in portdat.h

8 years agokernel: have to validate argv[] again when copying to the new stack
cinap_lenrek [Thu, 6 Aug 2015 11:20:41 +0000 (13:20 +0200)]
kernel: have to validate argv[] again when copying to the new stack

we have to validaddr() and vmemchr() all argv[] elements a second
time when we copy to the new stack to deal with the fact that another
process can come in and modify the memory of the process doing the
exec. so the argv[] strings could have changed and increased in
length. we just make sure the data being copied will fit into the
new stack and error when we would overflow.

also make sure to free the ESEG in case the copy pass errors.

8 years agokernel: limit argv[] strings to the USTKSIZE to avoid overflow
cinap_lenrek [Thu, 6 Aug 2015 09:51:23 +0000 (11:51 +0200)]
kernel: limit argv[] strings to the USTKSIZE to avoid overflow

argv[] strings get copied to the new processes stack segment, which
has a maximum size of USTKSIZE, so limit the size of the strings to
that and check early for overflow.

8 years agokernel: validnamedup() the name argument for segattach()
cinap_lenrek [Thu, 6 Aug 2015 09:48:51 +0000 (11:48 +0200)]
kernel: validnamedup() the name argument for segattach()

this moves the name validation out of segattach() to syssegattach()
to make sure the segment name cannot be changed by the user while
segattach looks at it.

8 years agokernel: fix indention in validname0()
cinap_lenrek [Thu, 6 Aug 2015 09:43:22 +0000 (11:43 +0200)]
kernel: fix indention in validname0()

8 years agokernel: limit syscallfmt user strings to 64K (as in validname)
cinap_lenrek [Thu, 6 Aug 2015 09:42:05 +0000 (11:42 +0200)]
kernel: limit syscallfmt user strings to 64K (as in validname)

8 years agokernel: change vmemchr() length argument to ulong and simplify
cinap_lenrek [Thu, 6 Aug 2015 08:15:07 +0000 (10:15 +0200)]
kernel: change vmemchr() length argument to ulong and simplify

8 years agokernel: use Etoolong[] constant instead of string literal in validname0()
cinap_lenrek [Thu, 6 Aug 2015 08:01:45 +0000 (10:01 +0200)]
kernel: use Etoolong[] constant instead of string literal in validname0()

8 years agokernel: make shargs() function static in sysproc.c
cinap_lenrek [Thu, 6 Aug 2015 07:09:57 +0000 (09:09 +0200)]
kernel: make shargs() function static in sysproc.c

8 years agokernel: reject empty argv (argv[0] == nil) in sysexec()
cinap_lenrek [Thu, 6 Aug 2015 06:47:38 +0000 (08:47 +0200)]
kernel: reject empty argv (argv[0] == nil) in sysexec()

when executing a script, we did advance argp0 unconditionally
to replace argv[0] with the script name. this fails when
argv[] is empty, then we'd advance argp0 past the nil terminator.

the alternative would be to *not* advance if *argp0 == nil, but that
would require another validaddr() check for a case that is unlikely
to have been anticipated in most programs being invoked as
libc's ARGBEGIN macro assumes argv[0] being non-nil as it also
unconditionally advances the argv pointer.

to keep us sane, we now reject an empty argv[]. on entry, we
verify that argv[] is valid for at least two elements:
- the program name argv[0], has to be non-nil
- the first potential nil terminator in argv[1]

when argv[0] == nil, we throw Ebadarg "bad arg in system call"

8 years agoinit: do not run $home/lib/profile when cd $home failed
cinap_lenrek [Wed, 5 Aug 2015 12:09:02 +0000 (14:09 +0200)]
init: do not run $home/lib/profile when cd $home failed

avoiding follow up error messages, which is annoying and
quite common when running a terminal as "none" for testing.

8 years agokfs: set permission of / to 0775 on ream
cinap_lenrek [Wed, 5 Aug 2015 11:13:40 +0000 (13:13 +0200)]
kfs: set permission of / to 0775 on ream

this allows members of the -1 group to create new directories in /
without having to fiddle with the fileserver console. this also
makes it consistent to hjfs and cwfs.

8 years agocwfs: set permission of / to 0775 on ream
cinap_lenrek [Wed, 5 Aug 2015 11:06:11 +0000 (13:06 +0200)]
cwfs: set permission of / to 0775 on ream

this allows members of the -1 group to create new directories in /
without having to fiddle with the fileserver console. this also
makes it consistent to hjfs.

8 years agopc, pc64: remove unused psaux driver, cleanup devkbd
cinap_lenrek [Wed, 5 Aug 2015 08:44:03 +0000 (10:44 +0200)]
pc, pc64: remove unused psaux driver, cleanup devkbd

the psaux driver is not used in any kernel configuration and theres
no userspace mouse daemon. i8042auxcmds() is wrong as access
to the user buffer can fault and we are holding an ilocks.

little cleanups in devkbd.

8 years agodevkbd: disable mosue/keyboard on shutdown, disable ps2 mouse on init, remove kbdenab...
cinap_lenrek [Wed, 5 Aug 2015 07:22:07 +0000 (09:22 +0200)]
devkbd: disable mosue/keyboard on shutdown, disable ps2 mouse on init, remove kbdenable()/kbdinit()

on vmware, loading a new kernel sometimes reboots when
wiggling the mouse. disabling keyboard and mouse on
shutdown fixes the issue.
make sure ps2 mouse is disabled on init, will get re-enabled
in i8042auxenable().
keyboard isnt special anymore, we can just use the devreset
entry point in the device to do the keyboard initialization,
so kbdinit()/kbdenable() are not needed anymore.

8 years agokernel: remove unused qstate() function
cinap_lenrek [Tue, 4 Aug 2015 11:52:29 +0000 (13:52 +0200)]
kernel: remove unused qstate() function

8 years agodevkbd: poll pc keyboard before blocking on kbd.q
cinap_lenrek [Tue, 4 Aug 2015 11:43:35 +0000 (13:43 +0200)]
devkbd: poll pc keyboard before blocking on kbd.q

the keyboard stops sending interrupts when its fifo gets full,
which can happen on boot when keys get mashed while interrupts
are still disabled. to work arround this, call the keyboard
interrupt handler when kbd.q is starved before blocking.

8 years agopython: use altzone
cinap_lenrek [Tue, 4 Aug 2015 00:03:38 +0000 (02:03 +0200)]
python: use altzone

8 years agoape: implement altzone for tzset()
cinap_lenrek [Tue, 4 Aug 2015 00:01:41 +0000 (02:01 +0200)]
ape: implement altzone for tzset()