From 40177b86bf5108016fc3a275096e44dc4ada5e9c Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 6 Oct 2024 02:03:54 +0000 Subject: [PATCH] auth/as: dont pollute parents environment or namespace (thanks jrmu, sl) --- sys/src/cmd/auth/as.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/src/cmd/auth/as.c b/sys/src/cmd/auth/as.c index 7a2e87bc0..e54785ffd 100644 --- a/sys/src/cmd/auth/as.c +++ b/sys/src/cmd/auth/as.c @@ -71,6 +71,9 @@ main(int argc, char *argv[]) if(argc == 0) usage(); + /* don't pollute the parents environment / namespace */ + rfork(RFENVG|RFNAMEG); + if(becomeuser(argv[0]) < 0) sysfatal("can't change uid for %s: %r", argv[0]);