Commit graph

32 commits

Author SHA1 Message Date
cinap_lenrek 631aef280d ape: fix thread race with close() and select()
in ape close(), do the real filedescriptor _CLOSE() *after* we cleared
the _fdinfo[] slot because once closed, we dont own the slot anymore and
another process doing open() can trash the slot. make sure open() retuns
fd < OPEN_MAX.

double check in _startbuf() holding mux->lock if the fd is already buffered
preveting running double copyprocs on a fd.

dont zero the mux->rwant/ewant bitmaps at the end of select() as we do not
hold the mix->lock.

in _closebuf() kill copyproc while holding the mux->lock to make sure the
copyproc isnt holding it at the time it is killed. run kill() multiple times
to make sure the proc is gone.
2013-03-11 01:16:34 +01:00
cinap_lenrek d526ee0750 ape/malloc: make malloc and free threadsafe for python 2013-03-11 00:55:26 +01:00
cinap_lenrek 48b0c10681 ape/stdio: make fopen() quasi threadsafe for python
python uses processes sharing memory. it requires at least fopen() to
be called by multiple threads at once so we introduce _IO_newfile()
which allocates the FILE structure slot under a lock.
2013-03-11 00:48:35 +01:00
cinap_lenrek 530a2bc5e9 ape: check for invalid filedescriptors in select() 2013-03-10 18:35:07 +01:00
cinap_lenrek 8b72726549 ape: add PASS_MAX constant for getpass() to limits.h (from patch/ape-pass_max)
add PASS_MAX to limits.h for ape, and make getpass respect it. also increase the size of
the maximum passwords (we use long ones at work). Needed for native port of SVN (in progress).
2013-02-28 19:21:03 +01:00
ppatience0 f1727a6742 ape: fix bug in access() 2013-02-08 18:01:31 -05:00
cinap_lenrek 2de4e31f56 ape: fix getsockname() byte swaped ports (by yarikos)
APE's getsockname() returns port with bytes swapped (on 386).
2013-01-09 06:08:29 +01:00
cinap_lenrek 6cadd03bbe fix utf and rune handling in preparation for 32bit runes 2012-12-31 21:09:46 +01:00
cinap_lenrek 2fcd19f16e ape: fix memory leak and path limit in unlink()
db1 was leaked, and newname could overflow. fixed.
2012-12-03 19:16:22 +01:00
cinap_lenrek a16f5cd2a3 ape: forgot to set errno in access() for dir create fail 2012-12-03 18:54:56 +01:00
cinap_lenrek 4661934e31 ape: fix _grpmems(), access(), getppid(), cleanup
_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().
2012-12-03 18:47:41 +01:00
cinap_lenrek ee251568fb ape: putenv, add file :) 2012-12-03 06:47:01 +01:00
cinap_lenrek 84c930a078 ape: fix putenv()
writing /env in putenv() doesnt work. exec will create
new enviroment anyway. we have to modify environ array!
2012-12-03 06:44:30 +01:00
cinap_lenrek eb9de925c6 ape: fix more bugs, use /env and /proc instead of #e and #p, cleanup
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
2012-12-03 05:35:33 +01:00
cinap_lenrek f3842de5fd ape: initialize _tos and use _tos->pid for getpid() 2012-12-03 05:22:21 +01:00
cinap_lenrek 45b498c027 ape: fix buffer overflow in _envsetup() 2012-12-02 12:32:23 +01:00
cinap_lenrek be0301f458 calloc: check multiplication overflow 2012-08-19 10:50:39 +02:00
cinap_lenrek 4f33c88a51 import updated compilers from sources 2012-07-30 19:11:16 +02:00
cinap_lenrek 546cd2bea2 ape: fix symbol name collision for by renaming static timezone struct to tz 2011-06-04 21:44:21 +00:00
aiju 7a4e46d7ab fixed mktime bug 2011-06-03 13:06:28 +02:00
aiju 67daf453a7 fixed tzset(), hopefully hg timezone bug should be fixed now 2011-06-04 12:02:42 +02:00
aiju 6ab691048d added (unfinished) nanosleep to APE 2011-06-03 12:28:37 +00:00
cinap_lenrek 3a78a07143 ape: fix fread/fwrite, python: disable bytecode dumps, inst: rename textonly to start and remove inst/gui, add sys/lib/rootbind, cisfd(8) manpage 2011-05-10 05:33:43 +00:00
aiju 16892e5e6c fixed fread 2011-05-09 14:49:41 +00:00
aiju 9f13a6a654 fixed fwrite (hopefully didn't break anything) 2011-05-09 14:42:01 +00:00
cinap_lenrek 6c1b421882 build ape/z before everything else (openssl) 2011-05-03 19:05:58 +00:00
cinap_lenrek 53e0e51cbb ape: fix broken chmod for directories. (makes hg work again) 2011-05-03 16:56:50 +00:00
cinap_lenrek 5976fdfe42 remove stuff 2011-05-03 15:16:20 +00:00
cinap_lenrek 3a742c699f add zlib, bzlib and openssl ape ports 2011-05-03 09:56:35 +00:00
cinap_lenrek 5e45406a0d fixing perms 2011-03-30 18:29:07 +00: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