ref: 585cacd6dcd0974d3faa34ea464edc18925d5a00
parent: 6bd3180c38cb58f751962e28da656e9a24c3ad01
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Dec 19 10:50:30 EST 2020
acme: use global user string variable instead of getuser()
--- a/sys/src/cmd/acme/acme.c
+++ b/sys/src/cmd/acme/acme.c
@@ -329,7 +329,7 @@
if(pipe(pfd) < 0)
error("can't create pipe");- sprint(acmeerrorfile, "/srv/acme.%s.%d", getuser(), mainpid);
+ sprint(acmeerrorfile, "/srv/acme.%s.%d", user, mainpid);
fd = create(acmeerrorfile, OWRITE, 0666);
if(fd < 0){remove(acmeerrorfile);
--- a/sys/src/cmd/acme/dat.h
+++ b/sys/src/cmd/acme/dat.h
@@ -538,6 +538,7 @@
Buffer snarfbuf;
Rectangle nullrect;
int fsyspid;
+char *user;
char *cputype;
char *objtype;
char *home;
--- a/sys/src/cmd/acme/disk.c
+++ b/sys/src/cmd/acme/disk.c
@@ -19,7 +19,7 @@
char buf[128];
int i, fd;
- snprint(buf, sizeof buf, "/tmp/X%d.%.4sacme", getpid(), getuser());
+ snprint(buf, sizeof buf, "/tmp/X%d.%.4sacme", getpid(), user);
for(i='A'; i<='Z'; i++){buf[5] = i;
if(access(buf, AEXIST) == 0)
--- a/sys/src/cmd/acme/rows.c
+++ b/sys/src/cmd/acme/rows.c
@@ -667,7 +667,7 @@
textinsert(&w->tag, w->tag.file->nc, r+n+1, nr-(n+1), TRUE);
if(ndumped >= 0){/* simplest thing is to put it in a file and load that */
- sprint(buf, "/tmp/d%d.%.4sacme", getpid(), getuser());
+ sprint(buf, "/tmp/d%d.%.4sacme", getpid(), user);
fd = create(buf, OWRITE|ORCLOSE, 0600);
if(fd < 0){free(r);
--
⑨