diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-19 18:02:37 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-19 18:02:37 +0100 |
commit | eb1dfed9abb054e4708fcb13ac6d8d537914ac77 (patch) | |
tree | 268c17a0a6758485989c4ffe71a092563936259a /sys/src/cmd/ip | |
parent | fc5070c60057b6e02490e83f5d675786e8b8d83c (diff) |
libauth: change programs to use the new procsetuser() function
Diffstat (limited to 'sys/src/cmd/ip')
-rw-r--r-- | sys/src/cmd/ip/httpd/httpd.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/src/cmd/ip/httpd/httpd.c b/sys/src/cmd/ip/httpd/httpd.c index 657ae5487..9740a1185 100644 --- a/sys/src/cmd/ip/httpd/httpd.c +++ b/sys/src/cmd/ip/httpd/httpd.c @@ -129,16 +129,12 @@ main(int argc, char **argv) static void becomenone(char *namespace) { - int fd; - - fd = open("#c/user", OWRITE); - if(fd < 0 || write(fd, "none", strlen("none")) < 0) - sysfatal("can't become none"); - close(fd); + if(procsetuser("none") < 0) + sysfatal("can't become none: %r"); if(newns("none", nil) < 0) - sysfatal("can't build normal namespace"); + sysfatal("can't build normal namespace: %r"); if(addns("none", namespace) < 0) - sysfatal("can't build httpd namespace"); + sysfatal("can't build httpd namespace: %r"); } static HConnect* |