From 4661934e31d3eee9414eb44ffc5a7e355326bc31 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 3 Dec 2012 18:47:41 +0100 Subject: 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(). --- sys/src/ape/lib/ap/plan9/_envsetup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/src/ape/lib/ap/plan9/_envsetup.c') diff --git a/sys/src/ape/lib/ap/plan9/_envsetup.c b/sys/src/ape/lib/ap/plan9/_envsetup.c index 11f53dc81..21d6be3f4 100644 --- a/sys/src/ape/lib/ap/plan9/_envsetup.c +++ b/sys/src/ape/lib/ap/plan9/_envsetup.c @@ -44,7 +44,7 @@ _envsetup(void) nohandle = 0; fdinited = 0; cnt = 0; - dfd = _OPEN("/env", 0); + dfd = _OPEN("/env", OREAD); if(dfd < 0) goto done; psize = Envhunk; @@ -63,7 +63,7 @@ _envsetup(void) } strcpy(p, "/env/"); memcpy(p+5, d9->name, n+1); - f = _OPEN(p, 0); + f = _OPEN(p, OREAD); memset(p, 0, n+6); memcpy(p, d9->name, n); p[n] = '='; -- cgit v1.2.3