diff --git a/sys/src/libdraw/getsubfont.c b/sys/src/libdraw/getsubfont.c index 02634c466..8832aaa11 100644 --- a/sys/src/libdraw/getsubfont.c +++ b/sys/src/libdraw/getsubfont.c @@ -22,7 +22,7 @@ _getsubfont(Display *d, char *name) if(dolock) unlockdisplay(d); - fd = open(name, OREAD); + fd = open(name, OREAD|OCEXEC); if(fd < 0) { fprint(2, "getsubfont: can't open %s: %r\n", name); f = nil; diff --git a/sys/src/libdraw/init.c b/sys/src/libdraw/init.c index f6f2551db..b02ced89b 100644 --- a/sys/src/libdraw/init.c +++ b/sys/src/libdraw/init.c @@ -49,7 +49,7 @@ geninitdraw(char *devdir, void(*error)(Display*, char*), char *fontname, char *l return -1; } if(fontname == nil){ - fd = open("/env/font", OREAD); + fd = open("/env/font", OREAD|OCEXEC); if(fd >= 0){ n = read(fd, buf, sizeof(buf)); if(n>0 && nwindir); - fd = open(buf, OREAD); + fd = open(buf, OREAD|OCEXEC); if(fd >= 0){ read(fd, display->oldlabel, (sizeof display->oldlabel)-1); close(fd); - fd = create(buf, OWRITE, 0666); + fd = create(buf, OWRITE|OCEXEC, 0666); if(fd >= 0){ write(fd, label, strlen(label)); close(fd); @@ -125,7 +125,7 @@ gengetwindow(Display *d, char *winname, Image **winp, Screen **scrp, int ref) obuf[0] = 0; retry: - fd = open(winname, OREAD); + fd = open(winname, OREAD|OCEXEC); if(fd<0 || (n=read(fd, buf, sizeof buf-1))<=0){ if(fd >= 0) close(fd); strcpy(buf, "noborder"); @@ -345,7 +345,7 @@ _closedisplay(Display *disp, int isshutdown) display = nil; if(disp->oldlabel[0]){ snprint(buf, sizeof buf, "%s/label", disp->windir); - fd = open(buf, OWRITE); + fd = open(buf, OWRITE|OCEXEC); if(fd >= 0){ write(fd, disp->oldlabel, strlen(disp->oldlabel)); close(fd); diff --git a/sys/src/libdraw/newwindow.c b/sys/src/libdraw/newwindow.c index 2fb708bef..73306be03 100644 --- a/sys/src/libdraw/newwindow.c +++ b/sys/src/libdraw/newwindow.c @@ -13,7 +13,7 @@ newwindow(char *str) wsys = getenv("wsys"); if(wsys == nil) return -1; - fd = open(wsys, ORDWR); + fd = open(wsys, ORDWR|OCEXEC); if(fd < 0){ free(wsys); return -1; diff --git a/sys/src/libdraw/openfont.c b/sys/src/libdraw/openfont.c index 7e94627a4..6d4aa2d2f 100644 --- a/sys/src/libdraw/openfont.c +++ b/sys/src/libdraw/openfont.c @@ -12,7 +12,7 @@ readfile(char *name) n = 0; r = -1; if((s = malloc(HUNK)) != nil){ - if((f = open(name, OREAD)) >= 0){ + if((f = open(name, OREAD|OCEXEC)) >= 0){ while((r = read(f, s+n, HUNK)) > 0){ n += r; r = -1; diff --git a/sys/src/libdraw/writecolmap.c b/sys/src/libdraw/writecolmap.c index 26c1f7f1f..30efdf64a 100644 --- a/sys/src/libdraw/writecolmap.c +++ b/sys/src/libdraw/writecolmap.c @@ -16,7 +16,7 @@ writecolmap(Display *d, RGB *m) ulong r, g, b; sprint(buf, "/dev/draw/%d/colormap", d->dirno); - fd = open(buf, OWRITE); + fd = open(buf, OWRITE|OCEXEC); if(fd < 0) drawerror(d, "writecolmap: open colormap failed"); t = malloc(8192);