diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-07 14:24:51 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-07 14:24:51 +0100 |
commit | f1e15da8f550b12196d57e245437251f6eb289b5 (patch) | |
tree | 056e930a518b6e4a5e993fcad133ba4bc9855a01 /sys/src/libc/9sys/getnetconninfo.c | |
parent | 544bca0290df1dc512641a1ab23e184ccc2406b3 (diff) |
libc: open internal file-descriptor with OCEXEC flag
Diffstat (limited to 'sys/src/libc/9sys/getnetconninfo.c')
-rw-r--r-- | sys/src/libc/9sys/getnetconninfo.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/src/libc/9sys/getnetconninfo.c b/sys/src/libc/9sys/getnetconninfo.c index 8dbb95f89..e21dcc306 100644 --- a/sys/src/libc/9sys/getnetconninfo.c +++ b/sys/src/libc/9sys/getnetconninfo.c @@ -13,7 +13,7 @@ getendpoint(char *dir, char *file, char **sysp, char **servp) sys = serv = 0; snprint(buf, sizeof buf, "%s/%s", dir, file); - fd = open(buf, OREAD); + fd = open(buf, OREAD|OCEXEC); if(fd >= 0){ n = read(fd, buf, sizeof(buf)-1); if(n>0){ @@ -41,7 +41,6 @@ getnetconninfo(char *dir, int fd) NetConnInfo *nci; char *cp; Dir *d; - char spec[10]; char path[128]; char netname[128], *p; @@ -76,10 +75,8 @@ getnetconninfo(char *dir, int fd) /* figure out bind spec */ d = dirstat(nci->dir); - if(d != nil){ - sprint(spec, "#%C%d", d->type, d->dev); - nci->spec = strdup(spec); - } + if(d != nil) + nci->spec = smprint("#%C%d", d->type, d->dev); if(nci->spec == nil) nci->spec = unknown; free(d); |