diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-06-03 23:30:05 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-06-03 23:30:05 +0200 |
commit | a2623fd82a1a49ee588b1ff14b0aa472d30a5ee2 (patch) | |
tree | 02e9e9340c94a215caac4e1c2333fbbce0c2cf0a | |
parent | 182077ac24010f8065755ea903bf57c829b0220a (diff) |
devenv: make #ec files not show up as world writable
-rw-r--r-- | sys/man/3/env | 1 | ||||
-rw-r--r-- | sys/src/9/port/devenv.c | 7 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/man/3/env b/sys/man/3/env index 2724f2ac4..0318f3488 100644 --- a/sys/man/3/env +++ b/sys/man/3/env @@ -49,7 +49,6 @@ such as those set in All processes see the same .BR #ec ; its contents are writable only by the host owner. -[XXX actually everything is world writable; that's a mistake.] .SH SEE ALSO .IR rc (1), .IR fork (2), diff --git a/sys/src/9/port/devenv.c b/sys/src/9/port/devenv.c index 4e12ad514..2308ad283 100644 --- a/sys/src/9/port/devenv.c +++ b/sys/src/9/port/devenv.c @@ -37,7 +37,7 @@ envgen(Chan *c, char *name, Dirtab*, int, int s, Dir *dp) Evalue *e; if(s == DEVDOTDOT){ - devdir(c, c->qid, "#e", 0, eve, DMDIR|0775, dp); + devdir(c, c->qid, "#e", 0, eve, 0775, dp); return 1; } @@ -56,7 +56,8 @@ envgen(Chan *c, char *name, Dirtab*, int, int s, Dir *dp) /* make sure name string continues to exist after we release lock */ kstrcpy(up->genbuf, e->name, sizeof up->genbuf); - devdir(c, e->qid, up->genbuf, e->len, eve, 0666, dp); + devdir(c, e->qid, up->genbuf, e->len, eve, + eg == &confegrp || eg != up->egrp ? 0664: 0666, dp); runlock(eg); return 1; } @@ -394,7 +395,7 @@ ksetenv(char *ename, char *eval, int conf) char buf[2*KNAMELEN]; snprint(buf, sizeof(buf), "#e%s/%s", conf?"c":"", ename); - c = namec(buf, Acreate, OWRITE, 0600); + c = namec(buf, Acreate, OWRITE, 0666); devtab[c->type]->write(c, eval, strlen(eval), 0); cclose(c); } |