_grpmems() was broken tokenizing group list in place.
we have to copy it to status buffer before tokenizing.
dynamically alloc path for test file to check write
permission on directory and add pid to the name to
prevent races.
use _OPEN instead of ape open to read /dev/ppid in
getppid().
use mode enums instead of numeric constants for _OPEN()
and _CREATE().
remove envname length limitation in _envsetup()
by using allocated buffer and use /env instead of #e
use /proc and getpid() instead of #p and #c in
readprocfdinit()
fix buffer overflow in execlp(), check if name
of failed exec starts with / . or is \0
make sure not to close our own filedescriptors
for FD_CLOEXEC in execve(), fix wrong length
check for flushing buffer to /env/_fdinfo.
fix error handling cases. copy the enviroment
before decoding \1 to \0 because the strings in
environ[] array might not be writable.
remove bogus close if we fail to open ppid file
in getppid() and use /dev/ppid instead of #c/ppid
setting Asud in the cmd register is not needed, because
Apwr is (Asud|Apod) already. the problem really was that
the drive comes up with sstatus Spresent (001), so we never
spun it up because (p->sstatus & Sphylink) == 0 was never
met (Sphylink being a mask (011) overlaping Spresent bit).
the spinup wait loop has to run only for the staggered spinup
case (h->cap & Hss) and it should wait for the drive to be
detected by the phy, not just cold presence detect.
thinkpad r400 dvd drive was not recognized. port status
indicated present device but no Sphylink because the
device did not spin up. setting the Asud bit in ahciconfigdrive()
made it come up clean.
add scsciverify() call in iaverify() for atapi inquiry.
keep in some of the debug prints and add a *ahcidebug= boot
parameter to enable them.
fix repeatproc timeout handling, add constants for Kbdelay
and Kbrepeat.
set procname so one knows which is keyboard and which is mouse
and on what endpoints they work.
9front's /dev/mousein and /dev/kbdin allow multiple opens,
so theres no need for the refcounted Kin structures.
spawn the worker procs in ther own note group, so they wont
get killed on interrupt in the original notegroup.
when -8 flag is given, upas/marshal override To:, Cc: and Bcc: headers.
add -B option for Bcc. it is also now valid to pass recipient list
on upas/marshal arguments and have -8 flag set. make nedmail and
/rc/bin/mail call upas/marshal with -8 now to make it effective.
bios takeover was broken. bad Ceecpmask (was 8, should be 0xFF)
causing it to miss the legacy control ecap and properly take
overship of the controller. also the order seems wrong, we
have to takeover before we do anything with the controller.
remove the pci config space 0xc0 = 0x2000 write. this the
uhci legacy register. its not anywhere in the ehci spec.
regarding the ohci spec, a overrun td might supply a full
packet of data. this change seemed to have caused nusb/kb to
fail with getting spurious zero byte reads. reverting for now.
handle short reads as errors and retry. this can happen
on ohci and some ps2 to usb converter. it might'v deen caused
by a recent change on sources handling td overrun differently.
fix error handling. have to check f->ep == nil after recovery
and check packet size. also, use f->ep->dfd instead of ptrfd
and kbdfd as it might be different after recovery. make a
setleds() error non fatal.
boost process priority for keyboard and mouse worker processes.
cleanup: use single write() in putmod(), improve error reporting.
implement SMM emulation driver handover in ohcireset(). this fixes
hang and defunct internal keyboard problems on a acer notebook.
dont spin forever waiting for the controller on soft reset in init().
check both, donehead pointer *and* interrupt status for
processed td event (Wdh) similar to the ohci spec example for
processed tds and unlink immidiately. acknowledge *all* the
interrupt status bits before masking. mask out unhandled
events.
various stuff:
check for christmas light interrupt status (cardbus controller
removed?)
add (missing?) break for Tddataovr error case in qhinterrupt().
(changed on sources, not clear why?)
mask interrupt events on shutdown() (from sources).
the syscallno check in syscallfmt() was wrong. the unsigned
syscall number was cast to an signed integer. so negative
values would pass the check provoking bad memory access from
kernel. the check also has an off by one. one has to check
syscallno >= nsyscalls instead of syscallno > nsyscalls.
access to the p->syscalltrace string was not protected
from modification in devproc. you could awake the process
and cause it to free the string giving an opportunity for
the kernel to access bad memory. or someone could kill the
process (pexit would just free it).
now the string is protected by the usual p->debug qlock. we
also keep the string arround until it is overwritten again
or the process exists. this has the nice side effect that
one can inspect it after the process crashed.
another problem was that our validaddr() would error() instead
of pexiting the current process. the code was changed to only
access up->s.args after it was validated and copied instead of
accessing the user stack directly. this also prevents a sneaky
multithreaded process from chaning the arguments under us.
in case our validaddr() errors, we cannot assume valid user
stack after the waserror() if block. use up->s.arg[0] for the
noted() call to avoid bad access.