#include <minix/ds.h>
#include <minix/endpoint.h>
#include <minix/chardriver.h>
+#include <minix/rs.h>
+#include <sys/types.h>
+#include <pwd.h>
#include "mq.h"
#include "qp.h"
int timerand, fd;
u8_t randbits[32];
struct timeval tv;
+ struct passwd *pw;
#if DEBUG
printf("Starting inet...\n");
ip_panic(("inet: can't subscribe to driver events"));
}
+ /* Drop root privileges */
+ if ((pw = getpwnam(SERVICE_LOGIN)) == NULL)
+ ip_panic(("inet: unable to retrieve uid of SERVICE_LOGIN"));
+ if (setuid(pw->pw_uid) != 0)
+ ip_panic(("inet: unable to drop privileges"));
+
/* Announce we are up. INET announces its presence to VFS just like
* any other character driver.
*/