From 13065e16b3c4fba4d9200ed7fec89ee49338f12a Mon Sep 17 00:00:00 2001 From: Jacob Moody Date: Fri, 10 Jun 2022 04:10:54 +0000 Subject: auth/box: don't bother switching to none Changing the user to none doesn't do much for us here. For kernel drivers that check the user of the current proc we'll be none, but anything from devmnt will still be accessed using creds from the original attachment. Instead, running with none can be done by chaining with auth/none: auth/none auth/box ... --- sys/src/cmd/auth/box.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sys/src') diff --git a/sys/src/cmd/auth/box.c b/sys/src/cmd/auth/box.c index e2dac74c6..30eedce7d 100644 --- a/sys/src/cmd/auth/box.c +++ b/sys/src/cmd/auth/box.c @@ -163,17 +163,12 @@ main(int argc, char **argv) mflags[nparts++] = MREPL; argv[0] = b; - rfork(RFNAMEG|RFENVG); + rfork(RFNAMEG|RFFDG); dfd = open("/dev/drivers", OWRITE|OCEXEC); if(dfd < 0) sysfatal("could not /dev/drivers: %r"); resolvenames(parts, nparts); - - if(procsetuser("none") < 0) - sysfatal("cant become none: %r"); - putenv("user", "none"); - sandbox(parts, mflags, nparts); if(debug) -- cgit v1.2.3