diff options
author | paul <paul> | 2003-06-04 08:49:13 +0000 |
---|---|---|
committer | paul <paul> | 2003-06-04 08:49:13 +0000 |
commit | a0f116e05cd753bb29dd9b446d0171b3c4445462 (patch) | |
tree | 0280c14519c94ad16d30b96398dd795ef4d6a312 | |
parent | 2e6dcf096e3bb95a26cb6ba42aae95f0ee43fea4 (diff) | |
download | quagga-a0f116e05cd753bb29dd9b446d0171b3c4445462.tar.bz2 quagga-a0f116e05cd753bb29dd9b446d0171b3c4445462.tar.xz |
Paul Jakma: merge_zprivs_head_4
-rwxr-xr-x | configure.ac | 2 | ||||
-rwxr-xr-x | configure.in | 4 | ||||
-rw-r--r-- | zebra/ipforward_solaris.c | 52 |
3 files changed, 33 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac index e2ada48c..341f185a 100755 --- a/configure.ac +++ b/configure.ac @@ -1021,6 +1021,6 @@ host operationg system : ${host_os} source code location : ${srcdir} compiler : ${CC} compiler flags : ${CFLAGS} -directory for state files : ${zebra_statedir} +state file directory : ${zebra_statedir} linker flags : ${LDFLAGS} ${LIBS} " diff --git a/configure.in b/configure.in index 8bed95c7..341f185a 100755 --- a/configure.in +++ b/configure.in @@ -160,7 +160,7 @@ AC_DEFINE_UNQUOTED(ZEBRA_GROUP, "${enable_group}", Zebra Group) if test x"${enable_vty_group}" = x"yes" ; then AC_MSG_ERROR([--enable-vty-group requires a group as argument]) fi -if test "${enable_vty_group}" != ""; then +if test "${enable_vty_group}" = ""; then AC_MSG_ERROR([--enable-vty-group requires a group as argument]) fi if test x"${enable_vty_group}" != x"no"; then @@ -1021,6 +1021,6 @@ host operationg system : ${host_os} source code location : ${srcdir} compiler : ${CC} compiler flags : ${CFLAGS} -directory for state files : ${zebra_statedir} +state file directory : ${zebra_statedir} linker flags : ${LDFLAGS} ${LIBS} " diff --git a/zebra/ipforward_solaris.c b/zebra/ipforward_solaris.c index 8d0618aa..27a3afde 100644 --- a/zebra/ipforward_solaris.c +++ b/zebra/ipforward_solaris.c @@ -44,6 +44,7 @@ extern struct zebra_privs_t zserv_privs; ** name of the parameter being referenced. */ + static int solaris_nd(const int cmd, const char* parameter, const int value) { @@ -74,33 +75,40 @@ solaris_nd(const int cmd, const char* parameter, const int value) 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; - } + 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); - if (errno) { - zlog_warn("failed to convert returned value to integer - %s",strerror(errno)); - retval = -1; + if (cmd == ND_GET) + { + errno = 0; + retval = atoi(nd_buf); + if (errno) + { + zlog_warn("failed to convert returned value to integer - %s", + strerror(errno)); + retval = -1; + } + } + else + { + retval = 0; } - } else { - retval = 0; - } return retval; } |