diff options
author | paul <paul> | 2003-05-25 21:29:54 +0000 |
---|---|---|
committer | paul <paul> | 2003-05-25 21:29:54 +0000 |
commit | ff8c45e1d68d32731f78f9b814ccfec976165a6c (patch) | |
tree | 6ee2bab62dcf27faf9f759db68fd81f790dd4235 | |
parent | 45f5468f02fc7c945041c3cf291bf7ad59bce35a (diff) | |
download | quagga-ff8c45e1d68d32731f78f9b814ccfec976165a6c.tar.bz2 quagga-ff8c45e1d68d32731f78f9b814ccfec976165a6c.tar.xz |
Rivo Nurgess: privs support for ipforward_solaris.c
-rw-r--r-- | zebra/ipforward_solaris.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zebra/ipforward_solaris.c b/zebra/ipforward_solaris.c index 63d1110c..3f6155cf 100644 --- a/zebra/ipforward_solaris.c +++ b/zebra/ipforward_solaris.c @@ -67,16 +67,26 @@ solaris_nd(const int cmd, const char* parameter, const int value) strioctl.ic_timout = 0; strioctl.ic_len = ND_BUFFER_SIZE; strioctl.ic_dp = nd_buf; + + if ( zserv_privs.change (ZPRIVS_RAISE) ) + zlog_err ("solaris_nd: Can't raise privileges"); if ((fd = open (device, O_RDWR)) < 0) { zlog_warn("failed to open device %s - %s", device, strerror(errno)); + if ( zserv_privs.change (ZPRIVS_LOWER) ) + zlog_err ("solaris_nd: Can't lower privileges"); return -1; } if (ioctl (fd, I_STR, &strioctl) < 0) { + if ( zserv_privs.change (ZPRIVS_LOWER) ) + zlog_err ("solaris_nd: Can't lower privileges"); close (fd); zlog_warn("ioctl I_STR failed on device %s - %s", device,strerror(errno)); return -1; } close(fd); + if ( zserv_privs.change (ZPRIVS_LOWER) ) + zlog_err ("solaris_nd: Can't lower privileges"); + if (cmd == ND_GET) { errno = 0; retval = atoi(nd_buf); |