Call MkSockNode() as uid 0

Forgotten by: julian
This commit is contained in:
Brian Somers 1999-11-21 23:27:23 +00:00
parent 6a192c5e8c
commit 31dd45c4e0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53535
3 changed files with 22 additions and 1 deletions

View File

@ -457,7 +457,7 @@ ether_Create(struct physical *p)
*/
/* Create a socket node */
if (NgMkSockNode(NULL, &dev->cs, &p->fd) == -1) {
if (ID0NgMkSockNode(NULL, &dev->cs, &p->fd) == -1) {
log_Printf(LogWARN, "Cannot create netgraph socket node: %s\n",
strerror(errno));
free(dev);

View File

@ -32,6 +32,9 @@
#include <sys/ioctl.h>
#include <fcntl.h>
#ifndef NONETGRAPH
#include <netgraph.h>
#endif
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
@ -296,3 +299,18 @@ ID0kldload(const char *dev)
return result;
}
#endif
#ifndef NONETGRAPH
int
ID0NgMkSockNode(const char *name, int *cs, int *ds)
{
int result;
ID0set0();
result = NgMkSockNode(name, cs, ds);
log_Printf(LogID0, "%d = NgMkSockNode(\"%s\", &cs, &ds)\n",
result, name ? name : "");
ID0setuser();
return result;
}
#endif

View File

@ -49,3 +49,6 @@ extern void ID0setproctitle(const char *);
#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
extern int ID0kldload(const char *);
#endif
#ifndef NONETGRAPH
extern int ID0NgMkSockNode(const char *, int *, int *);
#endif