diff --git a/authrhosts.c b/authrhosts.c index de15085..2430e6f 100644 --- a/authrhosts.c +++ b/authrhosts.c @@ -1,6 +1,7 @@ #include #include #include +#include /* * return whether the user is authenticated. diff --git a/plan9.h b/plan9.h index 60b03a9..50faf8e 100644 --- a/plan9.h +++ b/plan9.h @@ -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 diff --git a/u9fs.c b/u9fs.c index 1856e1b..ae06496 100644 --- a/u9fs.c +++ b/u9fs.c @@ -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);