define this and that to answer warnings

This commit is contained in:
Charles Forsyth 2020-03-11 16:42:21 +00:00
parent 5dbcea700e
commit 9639caf117
3 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include <plan9.h>
#include <fcall.h>
#include <u9fs.h>
#include <netdb.h>
/*
* return whether the user is authenticated.

View File

@ -9,6 +9,8 @@
/* magic to get 64-bit stat on Linux, maybe others */
#define _FILE_OFFSET_BITS 64
#define _DEFAULT_SOURCE 1 /* also for ruserok */
#ifdef sgi
#define _BSD_TYPES 1 /* for struct timeval */
#include <sys/select.h>

4
u9fs.c
View File

@ -1430,7 +1430,9 @@ groupchange(User *u, User *g, char **ep)
return -1;
}
setreuid(0,0);
if(setreuid(0, 0) < 0){
/* can't get super-user, other calls will fail */
}
if(setregid(-1, g->id) < 0){
fprint(2, "setegid(%s/%d) failed in groupchange\n", g->name, g->id);
*ep = strerror(errno);